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
Is it possible to declare GQL schema in a way that allows returning model objects from query resolvers and serialize them into json later down the line? Let's say I have:
If I try to manually edit generated file to resolve e.g. id value and declare generic type arguments, I get static analysis error because generic type args of type parameters don't match anymore:
field<String?, Todo>(
'id',
// The argument type 'GraphQLScalarType<String, String>' can't be assigned to the parameter type 'GraphQLType<String?, Todo>'.
graphQLString,
resolve: (serialized, argumentValues) {
return serialized.id;
},
)
Is what I'm trying to achieve possible to implement using Angel? I have a feeling that I'm missing some important part here.
Cheers!
The text was updated successfully, but these errors were encountered:
Is it possible to declare GQL schema in a way that allows returning model objects from query resolvers and serialize them into json later down the line? Let's say I have:
and now I'd like my resolver to only care about what model data to return back:
If I try to run
todo
query it returns:Looks like this is because generated
todoGraphQLType
fields don't specifyresolve
parameter in which caseresolveFieldValue
returnsnull
:https://github.com/dukefirehawk/graphql_dart/blob/master/graphql_server/lib/graphql_server2.dart#L612
If I try to manually edit generated file to resolve e.g.
id
value and declare generic type arguments, I get static analysis error because generic type args oftype
parameters don't match anymore:Is what I'm trying to achieve possible to implement using Angel? I have a feeling that I'm missing some important part here.
Cheers!
The text was updated successfully, but these errors were encountered: