Description
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).
Metadata
Metadata
Assignees
Type
Projects
Status