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

Initializing schema from SDL breaks when using scalar in Input Objects #842

Closed
qonn opened this issue Mar 27, 2021 · 1 comment
Closed
Assignees
Labels
bug Something isn't working

Comments

@qonn
Copy link

qonn commented Mar 27, 2021

Currently, this breaks on v2.0.0,

Stack trace:

 An unhandled exception has occurred while executing the request.
      Tanka.GraphQL.SchemaBuilding.SchemaBuilderException: Type Date is not known by the builder.
         at Tanka.GraphQL.SchemaBuilding.ConnectionBuilder.EnsureTypeKnown(IType type)
         at Tanka.GraphQL.SchemaBuilding.ConnectionBuilder.Include(InputObjectType owner, KeyValuePair`2 field)
         at Tanka.GraphQL.SchemaBuilding.ConnectionBuilder.Include(InputObjectType owner, IEnumerable`1 fields)
         at Tanka.GraphQL.Tools.MergeTool.<>c__DisplayClass5_0.<MergeInputType>b__0(ConnectionBuilder connect)
         at Tanka.GraphQL.SchemaBuilding.SchemaBuilder.Connections(Action`1 connections)
         at Tanka.GraphQL.Tools.MergeTool.MergeInputType(ISchema right, SchemaBuilder builder, InputObjectType rightType)
         at Tanka.GraphQL.Tools.MergeTool.Schema(SchemaBuilder target, ISchema right)
         at Tanka.GraphQL.Tools.MergeTool.Schemas(SchemaBuilder target, ISchema[] schemas)
         at Tanka.GraphQL.Tools.MergeSchemaBuilderExtensions.Merge(SchemaBuilder builder, ISchema[] schemas)
         at Tanka.GraphQL.Tools.SchemaTools.MakeExecutableSchemaWithIntrospection(SchemaBuilder builder, IResolverMap resolvers, ISubscriberMap subscribers, IReadOnlyDictionary`2 converters, IReadOnlyDictionary`2 directives)
         at tanka_arguments_bug_test.Schemas..ctor(IResolverService resolverService) in C:\tanka-test\Schemas.cs:line 18
--- the rest of the stack trace were omitted due to only showing things related to depency injection ---

SDL:

scalar Date

input InputTest {
    timestamp: Date # <-- this breaks
}

type Query {
    getDate(date: Date): String 
}

type Mutation {
    addDate(date: Date, inputTest: InputTest): String
}

schema {
    query: Query
    mutation: Mutation
    subscription: Subscription
}

How to reproduce:

Just follow the project here https://github.com/pekkah/tanka-graphql/tree/master/dev/graphql.dev.chat.web and create a very basic custom scalar and start using it in any Input Object.

Tanka GraphQL Version:
Nuget v2.0.0

@qonn
Copy link
Author

qonn commented Mar 27, 2021

After some more investigation, It turns out that this only happen when calling MakeExecutableSchemaWithIntrospection(), so I guess it has something to do with how the SchemaBuilder.Merge work.

@pekkah pekkah self-assigned this Jun 14, 2021
@pekkah pekkah added the bug Something isn't working label Jun 14, 2021
@pekkah pekkah closed this as completed in 439bf3e Jun 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants