Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Format Exception when registering types #787

Closed
kwemou opened this issue May 24, 2019 · 2 comments · Fixed by #786
Closed

Format Exception when registering types #787

kwemou opened this issue May 24, 2019 · 2 comments · Fixed by #786
Assignees
Milestone

Comments

@kwemou
Copy link

kwemou commented May 24, 2019

Describe the bug
When registering some types, I get the following exception:
at System.Text.StringBuilder.AppendFormatHelper(IFormatProvider provider, String format, ParamsArray args)
at System.String.FormatHelper(IFormatProvider provider, String format, ParamsArray args)
at System.String.Format(IFormatProvider provider, String format, Object[] args)
at HotChocolate.Types.FieldInitHelper.CompleteFields[TTypeDef,TFieldType,TFieldDef](ICompletionContext context, TTypeDef definition, IReadOnlyCollection1 fields) in C:\hc\src\Core\Types\Types\Helpers\FieldInitHelper.cs:line 54 at HotChocolate.Types.TypeSystemObjectBase1.CompleteType(ICompletionContext context) in C:\hc\src\Core\Types\Types\TypeSystemObjectBase~1.cs:line 89
at HotChocolate.Configuration.TypeInitializer.b__43_0(RegisteredType registeredType) in C:\hc\src\Core\Types\Configuration\TypeInitializer.cs:line 435
at HotChocolate.Configuration.TypeInitializer.CompleteTypes(TypeDependencyKind kind, Func2 action) in C:\hc\src\Core\Types\Configuration\TypeInitializer.cs:line 454 at HotChocolate.Configuration.TypeInitializer.CompleteTypes() in C:\hc\src\Core\Types\Configuration\TypeInitializer.cs:line 438 at HotChocolate.Configuration.TypeInitializer.Initialize(Func1 schemaResolver) in C:\hc\src\Core\Types\Configuration\TypeInitializer.cs:line 109
at HotChocolate.SchemaBuilder.InitializeTypes(IServiceProvider services, IDescriptorContext descriptorContext, IBindingLookup bindingLookup, IEnumerable1 types, Func1 schemaResolver) in C:\hc\src\Core\Types\SchemaBuilder.Create.cs:line 184
at HotChocolate.SchemaBuilder.Create() in C:\hc\src\Core\Types\SchemaBuilder.Create.cs:line 36

ObjectTypeUtil.txt

To Reproduce
Steps to reproduce the behavior:

  1. Create a entities and one query class and define them is a separate assembly that the asp .net core application assembly
  2. Load the assembly at runtime
  3. Register the entities and types using my ObjectTypeUtils attached:
    the ObjectTypeUtils use reflection to create ObjectType from given Type t
  4. Then when get the error you can see in the stack trace.

Expected behavior
A clear and concise description of what you expected to happen.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Version [9.0.0-preview.42]

Additional context
Asp.net core

@michaelstaib michaelstaib added the 🔍 investigate Indicates that an issue or pull request needs more information. label May 24, 2019
@michaelstaib
Copy link
Member

Thank you for reporting this issue.

I have fixed the error message now. It basically says that you object has no valid fields.

Since you are on V9 I recommend using the schema builder:

SchemaBuilder.New()
   .AddType(YOURPOCOTYPE)
   .Create()

The bug is fixed with 9.0.0-rc.1 which should be completed in the next 30 min.

@michaelstaib michaelstaib added bug and removed 🔍 investigate Indicates that an issue or pull request needs more information. labels May 24, 2019
@michaelstaib michaelstaib added this to the 9.0.0 milestone May 24, 2019
@michaelstaib michaelstaib self-assigned this May 24, 2019
@kwemou
Copy link
Author

kwemou commented Jun 5, 2019

Thank you very much
COOLLL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants