Skip to content
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

Upgrade to graphql-js 14.0 #140

Closed
8 tasks done
MichalLytek opened this issue Sep 1, 2018 · 15 comments
Closed
8 tasks done

Upgrade to graphql-js 14.0 #140

MichalLytek opened this issue Sep 1, 2018 · 15 comments
Assignees
Labels
Chore 🔨 Work not related with main project goal
Milestone

Comments

@MichalLytek
Copy link
Owner

MichalLytek commented Sep 1, 2018

https://github.com/graphql/graphql-js/releases/tag/v14.0.0

  • check if @types/graphql has been upgraded too
  • wait for fix of result errors typings
  • wait for all deps (devDeps) upgrade to v14
  • wait for graphql-query-complexity case (apollo-server variables)
  • upgrade code that use deprecated features (e.g. introspectionQuery)
  • add engine entry to package.json + drop support for Node.js 9 in Travis config
  • check if all tests pass & fix them
  • investigate the need of switching to peer dependency or reexporting graphql-js internals

ETA: Release 0.15

@MichalLytek MichalLytek added the Chore 🔨 Work not related with main project goal label Sep 1, 2018
@MichalLytek MichalLytek added this to the 1.0.0 release milestone Sep 1, 2018
@MichalLytek MichalLytek self-assigned this Sep 1, 2018
@floross
Copy link

floross commented Sep 17, 2018

* [x]  check if `@types/graphql` has been upgraded too

@types/graphql has been update to match with the version 14.x.x
https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/graphql

@floross floross mentioned this issue Sep 17, 2018
5 tasks
@MichalLytek MichalLytek added the Blocked 🚫 Resolving this issue is blocked by other issue or 3rd party stuffs label Sep 23, 2018
@MichalLytek
Copy link
Owner Author

There is a blocker for now as graphql-yoga is not compatible with graphql-js v14:
dotansimha/graphql-yoga#449

PR #152 has been closed as there's plenty of type error to fix to even make the tests pass.

@kallaspriit
Copy link

I'm in a kind of a deadlock where some of my dependencies require graphql 14.x.x but I can't upgrade because type-graphql doesn't work with it (Error: Cannot use GraphQLSchema "[object Object]" from another module or realm.).

Why is it not possible to upgrade type-graphql's dependencies because graphql-yoga has not updated as graphql-yoga is only used for examples right, the actual code-base does not depend on it?

I don't care if the examples break for a while or maybe the examples could be moved to a separate repository/package and just use the older compatible versions?

@MichalLytek
Copy link
Owner Author

I'm in a kind of a deadlock where some of my dependencies require graphql 14.x.x but I can't upgrade because type-graphql doesn't work with it

Why you can't just wait with upgrades until all the graphql ecosystem packages upgrade to v14?

graphql-yoga is only used for examples right

No, it's also used in subscriptions tests.

don't care if the examples break for a while or maybe

But I do care if the tests pass, which is currently not possible due to graphql-yoga dependency in tests and typings issue:
DefinitelyTyped/DefinitelyTyped@202ed3a#commitcomment-30611873

@kallaspriit
Copy link

Ok, I'll try to find a working combination and wait for the ecosystem to catch up with v14. Thanks for the explanation.

@floross
Copy link

floross commented Sep 24, 2018

@kallaspriit A workaround to use this package with v14.x.x right now is to remove the node_modules inside type-graphql folder.

rm -r node_modules/type-graphql/node_modules

@MichalLytek
Copy link
Owner Author

graphql-yoga seems abandoned as Apollo Server 2.0 is doing the same job - putting all the subpackages into one nice single API. I've tested it and looks like only the graphql-subscriptions v1.0 is the blocker for now:
apollographql/apollo-server#1701

@kallaspriit
Copy link

I switched from graphql-yoga to using apollo server 2 as well, works great.

@MichalLytek
Copy link
Owner Author

MichalLytek commented Oct 1, 2018

@kallaspriit
For me apollo-server feels like a step backward - it's written in typescript but not for typescript consumers in mind:

image

Looks like I have to find more time for changing to apollo 😞
For now we're waiting on another issue 😛
apollographql/apollo-server#1755

@kallaspriit
Copy link

kallaspriit commented Oct 2, 2018

@19majkel94 are you using apollo-server directly or from the apollo-server-express etc package? It works fine for me with the express flavor.
image

Ok now I noticed that I'm still setting the context type manually indeed, should open an issue.

[edit] I see you already did.

@MichalLytek
Copy link
Owner Author

@kallaspriit So ApolloContext is your custom type? I can't find it in apollo-server packages 😕

@kallaspriit
Copy link

kallaspriit commented Oct 2, 2018

Unfortunately yeah

// properties provided to the context function of ApolloServer constructor
export interface ApolloContext {
  req: express.Request;
  [x: string]: any;
}

They should change it so that the ApolloServer constructor would accept the context type as a generic and packages like apollo-server-express should provide their defaults (req etc).

@MichalLytek
Copy link
Owner Author

MichalLytek commented Oct 5, 2018

[05.10]
We have another blockers 😆
davidyaha/graphql-redis-subscriptions#127
slicknode/graphql-query-complexity#7 (comment)

But I see the light in the end of the tunnel, I hope this week it will be done 😉

I know guys that you would like to have v14 support now but I have to take care about the whole project with all integrations showed in examples. I can't have guides in docs to use graphql-yoga that fails when trying to run examples or doing it in your own project.

[08.10]
I've made a contribution to graphql-redis-subscriptions and it's working now 🎉
I've fixed all the types issue found in TS 3.1.1, all the tests, refactored all examples, everythings is working.
The last thing is graphql-query-complexity complexity - I have to wait for apollo-server or graphql-yoga, or maybe temporary switch in this example to express-graphql? 🤔

@apiel
Copy link

apiel commented Oct 8, 2018

I did yarn upgrade but I keep getting:

[19:36:40] Starting compilation in watch mode...

src/index.ts:53:9 - error TS2322: Type 'import("/home/alex/dev/backend/node_modules/@types/graphql/type/schema").GraphQLSchema' is not assignable to type 'import("/home/alex/dev/backend/node_modules/@types/express-graphql/node_modules/@types/graphql/type/schema").GraphQLSchema'.
  Property 'extensionASTNodes' is missing in type 'GraphQLSchema'.

53         schema,
           ~~~~~~

  node_modules/@types/express-graphql/index.d.ts:32:9
    32         schema: GraphQLSchema;
               ~~~~~~
    The expected type comes from property 'schema' which is declared here on type 'OptionsData'

[19:36:53] Found 1 error. Watching for file changes.

How can I solve this properly? Or is this related to this issue?

Right now to solve this I do the following:
rm -rf node_modules/@types/graphql && cp -r node_modules/@types/express-graphql/node_modules/@types/graphql node_modules/@types/.

@MichalLytek MichalLytek removed the Blocked 🚫 Resolving this issue is blocked by other issue or 3rd party stuffs label Oct 14, 2018
@MichalLytek
Copy link
Owner Author

Released in 0.15.0! 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Chore 🔨 Work not related with main project goal
Projects
None yet
Development

No branches or pull requests

4 participants