Closed bardhyliis closed 2 years ago
Full error:
{ "errors": [ { "message": "The field id does not exist on the type CommandsConnection.", "locations": [ { "line": 59, "column": 9 } ], "path": [ "addCommandsIdentifier", "commandsIdentifier", "commands" ], "extensions": { "type": "CommandsConnection", "field": "id", "responseName": "id", "specifiedBy": "http://spec.graphql.org/October2021/#sec-Field-Selections-on-Objects-Interfaces-and-Unions-Types" } }, { "message": "The field content does not exist on the type CommandsConnection.", "locations": [ { "line": 60, "column": 9 } ], "path": [ "addCommandsIdentifier", "commandsIdentifier", "commands" ], "extensions": { "type": "CommandsConnection", "field": "content", "responseName": "content", "specifiedBy": "http://spec.graphql.org/October2021/#sec-Field-Selections-on-Objects-Interfaces-and-Unions-Types" } } ] }
id
CommandsConnection
content
the type:
` protected override void Configure(IObjectTypeDescriptor descriptor) { descriptor .ImplementsNode() .IdField(t => t.Id) .ResolveNode((ctx, id) => ctx.DataLoader().LoadAsync(id, ctx.RequestAborted));
descriptor .Field(t => t.Commands) .ResolveWith<CommandResolvers>(t => t.GetCommandsAsync(default!, default!, default!, default)) .UseDbContext<ApplicationDbContext>() .UsePaging<NonNullType<CommandType>>() .Name("commands"); }
`
and the query:
public class CommandQueries { [UseApplicationDbContext] [UsePaging(typeof(NonNullType<CommandType>))] public IQueryable<Command> GetCommands([ScopedService] ApplicationDbContext context) => context.Commands; }
Make sure you check the errors in the graphql document. 😫😫😫😫😫😫😫
Full error:
the type:
` protected override void Configure(IObjectTypeDescriptor descriptor)
{
descriptor
.ImplementsNode()
.IdField(t => t.Id)
.ResolveNode((ctx, id) => ctx.DataLoader().LoadAsync(id, ctx.RequestAborted));
`
and the query:
public class CommandQueries { [UseApplicationDbContext] [UsePaging(typeof(NonNullType<CommandType>))] public IQueryable<Command> GetCommands([ScopedService] ApplicationDbContext context) => context.Commands; }