More debugging info needed in general - "unable to infer or resolve a schema type from the type reference"

See original GitHub issue

Hi!

I switched from graphql.net due to hotchocolate having more features and seemingly better documentation.

But one big difference is that I’m getting a lot better debugging info in graphql.net, I find myself getting stuck over and over in HotChocolate.

I’m able to register some classes just fine and others just fail without any error message beyond:

HotChocolate.SchemaException: Multiple schema errors occured:
Unable to infer or resolve a schema type from the type reference `Input: ...IoProcess
Unable to infer or resolve a schema type from the type reference `Input: ...IoProcessRole
Unable to infer or resolve a schema type from the type reference `Input: ...IoProcess

The types that can’t be inferred have been defined below

services.AddGraphQL(sp => Schema.Create(c =>
            {
                c.RegisterServiceProvider(sp);
                c.RegisterQueryType<RootQueryType>();
                c.RegisterMutationType<MutationType>();
                c.RegisterType<Process>();
                c.RegisterType<ProcessType>();
                c.RegisterType<Project>();
                c.RegisterType<ProcessRole>();
                c.RegisterAuthorizeDirectiveType();
            }));

Here’s my bare bone process graphql type:

public class Process : ObjectType<IoProcess>
    {
        protected override void Configure(IObjectTypeDescriptor<IoProcess> descriptor)
        {
            descriptor.Name("Process");
            
            descriptor.Field(o => o.Id).Type<LongType>();
            //descriptor.Field(o => o.Name).Type<StringType>();
            //descriptor.Field(o => o.StartsAt).Type<DateTimeType>();
            //descriptor.Field(o => o.EndsAt).Type<DateTimeType>();
            //descriptor.Field(o => o.Type).Type<ProcessType>();
            //descriptor.Field(o => o.Parent).Type<Process>();
            //descriptor.Field(o => o.Roles).Type<ListType<ProcessRole>>();
            //descriptor.Field(o => o.Children).Type<ListType<Process>>();
            
        }
}

Any help would be greatly appreciated!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
LeotrimThorcommented, Apr 10, 2023

Hi, I am getting an error saying “Unable to infer or resolve a schema type from the type reference @AuthorizeDirective”. I have created an web api + graphql with entity framework. I am using -HotChocolate v13.0.5 -HotChocolate.AspNetCore v13.0.5 -HotChocolate.AspNetCore.Authorization v13.0.5 -.Net v6 The moment I set up the [Authorize] attribute to any of my methods in any class, the whole schema fails to connect and I cannot run any query. I would be very thankful for any kind of advice/help.

2reactions
michaelstaibcommented, Dec 16, 2021

We are constantly making this better… with 12 we added even more context to errors. I am closing this since we consider it an ongoing effort.

Read more comments on GitHub >

github_iconTop Results From Across the Web

More debugging info needed in general - "unable to infer ...
Hi, I am getting an error saying "Unable to infer or resolve a schema type from the type reference @AuthorizeDirective". I have created...
Read more >
Asp.net core hotchocolate graphql: ObjectType with an ...
HotChocolate.SchemaException: Unable to infer or resolve a schema type from the type referenceInput: IPlugin. I tried creating an Interfacetype ...
Read more >
Schema Configuration - Hot Chocolate v12
The name of a GraphQL type has to be unique. When you build a standalone GraphQL server, the schema validation will make sure...
Read more >
DynamicFrame class - AWS Glue
A DynamicFrame is similar to a DataFrame , except that each record is self-describing, so no schema is required initially. Instead, AWS Glue...
Read more >
Serverless SQL pool self-help - Azure Synapse Analytics
This article contains information about how to troubleshoot the most frequent problems with serverless SQL pool in Azure Synapse Analytics.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found