You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using "Request" syntax, the generated graphql is specifying that the mutation's input is not-nullable when the schema has the input for the same mutation as non-nullable.
This is not the case when using a lambda, in this case the nullability of the input in the generated graphql is correct.
This may also happen with queries, but I've only been using mutations.
How to Reproduce
Define a mutation request with a non-nullable input, it should produce graphql with an optional input.
publicsealedrecordCreateFoo(FooInputInput):GraphQL<Mutation,int>{publicoverrideintExcecute(Mutationquery)=>query.CreateFoo(Input,static x =>x.Id);}
Expected behavior
Should produce the following correct graphql:
mutationcreateFoo($input: FooInput!) { id }
Instead produces:
mutationcreateFoo($input: FooInput) { id }
The same operation using a lambda:
varvariables=new{input=newFooInput("Test")}varid=awaitclient.Mutation(variables,static(v,m)=>m.createFoo(v.input, s =>s.Id));
This lambda does produce the following:
mutation ($input: FooInput!) { createFoo(input: $input) { id } }
The GraphqQL schema that fails
type Foo {
id: Int!
}
type FooInput {
name: String!
}
type Mutation {
createFoo(
input: FooInput!
): Foo!
}
Screenshots
If applicable, add screenshots to help explain your problem.
Environment (please complete the following information):
Nuget package version 6.1.1
IDE: Visual Studio
OS: Windows 11
.Net Version tested on both 6.0.416 and 8.0.100
The text was updated successfully, but these errors were encountered:
Describe the bug
When using "Request" syntax, the generated graphql is specifying that the mutation's input is not-nullable when the schema has the input for the same mutation as non-nullable.
This is not the case when using a lambda, in this case the nullability of the input in the generated graphql is correct.
This may also happen with queries, but I've only been using mutations.
How to Reproduce
Define a mutation request with a non-nullable input, it should produce graphql with an optional input.
Expected behavior
Should produce the following correct graphql:
Instead produces:
The same operation using a lambda:
This lambda does produce the following:
The GraphqQL schema that fails
Screenshots
If applicable, add screenshots to help explain your problem.
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: