-
Notifications
You must be signed in to change notification settings - Fork 2k
Is there some good way to make GraphQLFieldResolveFn<SOURCET, VARIABLET>
<- like this?
#393
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I'm sorry, I'm having trouble understanding what you're asking. It appears to me that Relay's resolver is potentially dangerously typed, since executor does not guarantee that I'm not sure what you mean by |
@leebyron
can typed with a
The demonstration is here graphql-relay pr:89 (detail codes) . Could you have a look at this solution? If it is suitable. Then |
Already implemented so you can specify types for both source and args: graphql-js/src/type/definition.js Lines 781 to 785 in c2dfccf
|
Uh oh!
There was an error while loading. Please reload this page.
At now , GraphQLFieldResolveFn's definition is like this,
which
source: mixed
andargs: {[argName: string]: mixed}
But the Relay use a subset of those data ,In Relay, the resolver is assumed to something like this:
So when
Graphql-Relay
make a static flow type check with aflow typed Graphql
,this will make a conflict (mixed -> Object).I find
source
type are begin withexecute()
in execute.js .Butexecute()
should be called by a GraphQL server (like express-grapgql), so is it wired to use Template to makeResolveFn
to accept a new type which used by end-user (likerelay-graph
)?Also causeof the
source
separate many place ingraphql
's source code . and at now seems sometimes ifFlow
can not resolveTemplate
, it will set theTemplate
toany Type
. Use a wild-separated template makes me a little nervous.Is there some good way to make the
GraphQLFieldResolveFn
accept end-user's Flow type Rightly? ( in other words,makerelay-graph
typechecked withgraph
no conflict)The text was updated successfully, but these errors were encountered: