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
resolveType and isTypeOf in Grafast currently (or will once #2301 is closed) only support (value: any) => string | GraphQLObjectType call signature. GraphQL.js supports (value: any, context: any, resolveInfo: GraphQLResolveInfo, abstractType: GraphQLUnionType | GraphQLInterfaceType) => PromiseOrValue<string | GraphQLObjectType> signature. Ideally we don't want Grafast having to handle all the complexities of this for most Grafast schemas, however if the schema includes GraphQL.js emulation then we will need to. We should therefore add a flag such as emulateGraphQLJS?: boolean that enables resolveType and isTypeOf to run in GraphQL.js emulation mode (with the additional properties) - we'd accomplish this by running resolveType as a step much like the graphqlResolver, that way it can be satisfied asynchronously if needed.
We should also add a flag to the relevant extensions: unionType.extensions.grafast.emulateGraphQLJS; if set true then we'd emulate GraphQLJS for the type, if false we wouldn't, and if unset we'd default to the global emulateGraphQLJS flag passed to the grafast() function (or via the preset or whatever).
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
resolveType
andisTypeOf
in Grafast currently (or will once #2301 is closed) only support(value: any) => string | GraphQLObjectType
call signature. GraphQL.js supports(value: any, context: any, resolveInfo: GraphQLResolveInfo, abstractType: GraphQLUnionType | GraphQLInterfaceType) => PromiseOrValue<string | GraphQLObjectType>
signature. Ideally we don't want Grafast having to handle all the complexities of this for most Grafast schemas, however if the schema includes GraphQL.js emulation then we will need to. We should therefore add a flag such asemulateGraphQLJS?: boolean
that enablesresolveType
andisTypeOf
to run in GraphQL.js emulation mode (with the additional properties) - we'd accomplish this by runningresolveType
as a step much like thegraphqlResolver
, that way it can be satisfied asynchronously if needed.We should also add a flag to the relevant extensions:
unionType.extensions.grafast.emulateGraphQLJS
; if settrue
then we'd emulate GraphQLJS for the type, iffalse
we wouldn't, and if unset we'd default to the globalemulateGraphQLJS
flag passed to thegrafast()
function (or via the preset or whatever).The text was updated successfully, but these errors were encountered: