Open mrdulin opened 4 years ago
In this specific case, since the id
argument could be null, isOk
can be either true or false. But if you specify the argument's type as String!
, which is a non null string type, you'll be right and isOk
should be always true.
@Fontinalis Thanks. So I am thinking can this package can do this type assertion based on GraphQL fields' type for developer. So we don't need write this thing again and again.
Type cast code: https://github.com/graphql-go/graphql/blob/master/examples/todo/main.go#L156
args for type: https://github.com/graphql-go/graphql/blob/master/examples/todo/main.go#L149
Since the arguments validation is done in GraphQL schema layer.The
id
parameter must be a string type in resolver. So I think it's unnecessary to checkisOk
variable. Am I correct?