Graphback: Support GraphQL v15

Created on 7 Apr 2020  路  9Comments  路  Source: aerogear/graphback

It looks like Graphback has some incompatibilities with GraphQL-JS v15

src/relationships/RelationshipMetadataBuilder.ts(115,9): error TS2739: Type '{ name: string; description: string; type: GraphQLNonNull<GraphQLNullableType>; args: undefined[]; extensions: undefined[]; }' is missing the following properties from type 'GraphQLField<any, any, { [key: string]: any; }>': isDeprecated, deprecationReason
src/relationships/RelationshipMetadataBuilder.ts(128,9): error TS2739: Type '{ name: string; description: string; type: GraphQLOutputType; args: undefined[]; extensions: undefined[]; }' is missing the following properties from type 'GraphQLField<any, any, { [key: string]: any; }>': isDeprecated, deprecationReason
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Most helpful comment

Generate command needs to be there for the moment as we need to generate client side queries (and we can still generate schema for the time being for preview purposes)

All 9 comments

v15 is breaking version and due to our cli containing the GraphQL, we should hold with updating until the wider industry adapts it. Actuall work is not blocked and we can create PR or investigate how to this it.

Bumping this one. v15 is not compatible with how we build relationships but if that is all that is broken it should be easy enough to support v15

This is both urgent and both problematic. Flagging as topic for backlog refinement

graphback-cli has graphql as a direct dependency. For the CLI, is it just a matter of making it a peerDependency and removing it as a direct dependency?

"peerDependencies": {
  "graphql": "15.1.0"
}

Yes. We need to:

  • Ensure that init works without graphql (I believe it does)
  • Ensure that we can install cli without graphql
  • Ensure that cli will print info for the generate command if executed globally (not from the project)
  • Move entire graphback codebase to work with graphql 15.0.0 and bellow (some examples in graphql-tools are available)

Ensure that init works without graphql (I believe it does)

Yep it works fine without init.

The problem is that init is one subcommand of the CLI package - the openapi package uses graphql.

What we could do it split the CLI:

`@graphback-cli/init`
`@graphback-cli/openapi`

Ensure that cli will print info for the generate command if executed globally (not from the project)

Hmm, are we keeping the generate command? Looks like it is broken also (depends on config file.

graphback generate
<b>Generation failed: ConfigNotFoundError: GraphQL Config file is not available in the provided config directory: /home/ephelan/code/playground
Please check the config directory.</b>

Let's remove OpenApi package then. It was done to demo stuff and it is not providing any value than using upstream OpenAPiToGraphql.

I have done it before you joined project to win some engagement but it never actually succeeded. This command makes no sense in current platform

Generate command needs to be there for the moment as we need to generate client side queries (and we can still generate schema for the time being for preview purposes)

Generate command needs to be there for the moment as we need to generate client side queries (and we can still generate schema for the time being for preview purposes)

Ah yes - I will create an issue because it is broken.

Was this page helpful?
0 / 5 - 0 ratings