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

Feedback on v16.0.0-rc.1 #3245

Closed
IvanGoncharov opened this issue Aug 26, 2021 · 35 comments
Closed

Feedback on v16.0.0-rc.1 #3245

IvanGoncharov opened this issue Aug 26, 2021 · 35 comments

Comments

@IvanGoncharov
Copy link
Member

Can you please test your lib/project against https://github.com/graphql/graphql-js/releases/tag/v16.0.0-rc.1 and leave feedback on this issue.

@IvanGoncharov IvanGoncharov pinned this issue Aug 26, 2021
@kamilkisiela
Copy link

@apollo/federation:0.30.0 and previous versions

Cannot find module 'graphql/validation/rules/UniqueTypeNames'
at @apollo/federation/dist/composition/rules.js

@kamilkisiela
Copy link

Property 'isDeprecated' does not exist on type 'GraphQLField<any, any, { [argument: string]: any; }>'

Same story for Enums and other types.

@kamilkisiela
Copy link

ts(2724): '"graphql"' has no exported member named 'Visitor'. Did you mean 'visit'?

@kamilkisiela
Copy link

resolveType no longer accepts a type

  Type 'GraphQLObjectType<any, any>' is not assignable to type 'PromiseOrValue<string | undefined>'.
    Type 'GraphQLObjectType<any, any>' is not assignable to type 'string'.

I guess it previously was supported because of toString() and TS allowed for that, now it's not.

@PabloSzx
Copy link
Contributor

PabloSzx commented Aug 26, 2021

Could collectFields be re-exported from /execution/execute.ts? this will help @graphql-tools/utils to not break with graphql 16, see:

EDIT: Created PR #3246

@PabloSzx
Copy link
Contributor

Another thing, can a experimental-stream-defer version of this RC also be released?

@yaacovCR
Copy link
Contributor

Could collectFields be re-exported from /execution/execute.ts? this will help @graphql-tools/utils to not break with graphql 16, see:

fixed/refactored on main #3187

Could be backported

@PabloSzx
Copy link
Contributor

Could collectFields be re-exported from /execution/execute.ts? this will help @graphql-tools/utils to not break with graphql 16, see:

fixed/refactored on main #3187

Could be backported

#3246

@saihaj
Copy link
Member

saihaj commented Aug 26, 2021

Another thing, can a experimental-stream-defer version of this RC also be released?

Yeah we need this @IvanGoncharov. I was looking into graphiql and there defer and stream is used

@saihaj
Copy link
Member

saihaj commented Aug 27, 2021

express-graphql

Updating works fine all the tests pass. Only issue is that there peer deps conflicts which requires updating graphiql and subscriptions-transport-ws so once a new version for them is released we can update it

graphql-relay-js

There are expected breaking changes that require some changes. Since we no longer export flow types so we should do this upgrade part of TS migration.

@n1ru4l
Copy link
Contributor

n1ru4l commented Aug 27, 2021

Breaks 'apollo-server-core':

const apolloServer = new ApolloServerBase({ schema, debug });

yields in the exception

      Must provide document.

      at devAssert (node_modules/graphql/jsutils/devAssert.js:12:11)
      at assertValidExecutionArguments (node_modules/graphql/execution/execute.js:145:40)
      at Object.execute (node_modules/graphql/execution/execute.js:74:3)
      at Object.generateSchemaHash (node_modules/apollo-server-core/src/utils/schemaHash.ts:12:18)
      at ApolloServerBase.generateSchemaDerivedData (node_modules/apollo-server-core/src/ApolloServer.ts:671:24)
      at Object.schemaDerivedDataProvider (node_modules/apollo-server-core/src/ApolloServer.ts:288:18)
      at new SchemaManager (node_modules/apollo-server-core/src/utils/schemaManager.ts:75:15)
      at new ApolloServerBase (node_modules/apollo-server-core/src/ApolloServer.ts:283:24)

Seems like apollo-server is using the legacy execute call signature execute(schema, ...args) instead of execute({ schema, ...args })

@n1ru4l
Copy link
Contributor

n1ru4l commented Aug 27, 2021

Previously the mapAsyncIterator function could be imported via

import mapAsyncIterator from 'graphql/subscription/mapAsyncIterator.js';

but the export was changed to import { mapAsyncIterator } from 'graphql/subscription/mapAsyncIterator.js';

Could we still have a default export for having easy backward compatibility without having to inline the function into our libraries?

I created #3247 for this simple change

@n1ru4l
Copy link
Contributor

n1ru4l commented Aug 27, 2021

Parser class attributes are private and should be protected instead for implementing custom parsers. #3248

@n1ru4l
Copy link
Contributor

n1ru4l commented Aug 27, 2021

GraphQLError now has this:

https://github.com/n1ru4l/graphql-js/blob/4493ca3d1281e01635570824f70867aa68610323/src/error/GraphQLError.ts#L204-L207

But the comment indicates it should be removed? SHould this be removed or is the comment outdated? This also causes TS errors for apollo-server.

@n1ru4l
Copy link
Contributor

n1ru4l commented Aug 27, 2021

The breaking change for resolveType is unnecessary. We can have the signature

export type GraphQLTypeResolver<TSource, TContext> = (
  value: TSource,
  context: TContext,
  info: GraphQLResolveInfo,
  abstractType: GraphQLAbstractType,
) => PromiseOrValue<GraphQLObjectType | string | undefined>;

and then in the GraphQL.js 17 release change it to

export type GraphQLTypeResolver<TSource, TContext> = (
  value: TSource,
  context: TContext,
  info: GraphQLResolveInfo,
  abstractType: GraphQLAbstractType,
) => PromiseOrValue<string | undefined>;

That gives people and tooling around GraphQL.js more flexibility.

I created #3249 for this.

@ardatan
Copy link
Member

ardatan commented Aug 27, 2021

In < v15 there was visitorKeys parameter that allows us to visit only specified nodes;

visit(node, visitors, {
  SelectionSet: ['selections'],
  Field: ['selectionSet'],
  InlineFragment: ['selectionSet'],
  FragmentDefinition: ['selectionSet'],
})

But now there is no third parameter for visitorKeys. But this parameter was important for the runtime performance of Schema Stitching. We use visitorKeys to avoid visitor to visit unwanted nodes. Since we heavily use visit multiple times with different visitorKeys combinations, this is really important for the performance of Schema Stitching. I'd create a PR but unfortunately I couldn't find where this change was made because history is a bit confusing due to Flow->TS migration.

About all of the issues written here so far, I think it would be better not to release v16 until fixing these issues because those are heavily from the popular packages.
I'd be appreciated if my comment is noticed otherwise this kind of major release will lead much more issues because of this kind of breaking changes.

For this kind of breaking changes I'd suggest to keep backwards compatibility with a deprecation notice in the first major(maybe minor) release to warn people for upcoming breaking change then remove it completely on the following major.

@IvanGoncharov
Copy link
Member Author

IvanGoncharov commented Aug 27, 2021

@n1ru4l Thanks for your PRs to apollo-server.
I'm also working on the same fixes in parallel for Apollo server/client & federation.

Cannot find module 'graphql/validation/rules/UniqueTypeNames'
at @apollo/federation/dist/composition/rules.js

@kamilkisiela I will fix that in the federation repo.

Property 'isDeprecated' does not exist on type 'GraphQLField<any, any, { [argument: string]: any; }>'

@kamilkisiela Yes, it was first deprecated and then removed:

// @deprecated and will be removed in v16
isDeprecated: boolean,

You should use deprecationReason instead and it is also supported in v15.x.x

ts(2724): '"graphql"' has no exported member named 'Visitor'. Did you mean 'visit'?

It was renamed to ASTVisitor to match other names like ASTNode

@saihaj
Copy link
Member

saihaj commented Aug 27, 2021

@ardatan #2930 this PR removed visitorKeys we can try to revert this and convert to TS

@ardatan
Copy link
Member

ardatan commented Aug 27, 2021

@IvanGoncharov
I think we can export Visitor as an alias with a deprecation notice for now in order to keep backwards compatibility, no?
@saihaj Thank you. I'll create a PR soon.

@IvanGoncharov
Copy link
Member Author

I think we can export Visitor as an alias with a deprecation notice for now in order to keep backwards compatibility, no?

@ardatan ASTVisitor was added more than 2 years ago and is present in both v14 and v15, see:
9366d6d#diff-559cd403e97ad511680f66b39577aff06d8b4e71349b7dc8a4732a31a43ddf75R9

@IvanGoncharov
Copy link
Member Author

Released a https://github.com/graphql/graphql-js/releases/tag/v16.0.0-rc.3 with all fixes included, big thanks for all PRs 👍
Please feel free to report here or open a separate issue if you find some problem with RC3.
Also, I released v15.6.1 with some stuff backported from main, see: https://github.com/graphql/graphql-js/releases

@IvanGoncharov
Copy link
Member Author

I stuck with updating Apollo Server.
There are some conflicts between ApolloError and changes in theGraphQLError.
Was planning to fix it in graphql-js today (have a partial fix ready) but sadly was distracted by another community issue.
Will try to fix it over the weekend.

@yaacovCR
Copy link
Contributor

#3316

@IvanGoncharov
Copy link
Member Author

I figured migration path for GraphQLError from v15 to v16.
Just released RC6 and plan release 16.0.0 on Monday evening.
Not a lot of changes since previous releases but would be great if you can test it.

@PabloSzx
Copy link
Contributor

I feel like graphql/graphiql#1982 should be fixed before releasing v16

@IvanGoncharov
Copy link
Member Author

@PabloSzx I left a comment on how to fix it.
If you have time please test with GraphiQL.
As I'm forced by The Guild to release v16 before the next WG I don't have time to test it on GraphiQL.
So the release is happing on Monday unless anything major happens.

@saihaj
Copy link
Member

saihaj commented Oct 27, 2021

To test GraphiQL we need to publish RC version that has defer-and-stream support.

@IvanGoncharov
Copy link
Member Author

@saihaj Current plan:

@IvanGoncharov
Copy link
Member Author

@IvanGoncharov
Copy link
Member Author

As discussed on WG we are ready to cut release.
One thing it's better to do in the morning is to be on the safe side.
I will cut it first thing in the morning (around 7 AM UTC).

@IvanGoncharov
Copy link
Member Author

Release script is broke due to funny error:
image

It turns out we never tested src/version.ts on release without preReleaseTag.
Working on a fix will release in the short while.

@IvanGoncharov
Copy link
Member Author

Released https://github.com/graphql/graphql-js/releases/tag/v16.0.0 🎉

@saihaj
Copy link
Member

saihaj commented Oct 28, 2021

#3346

@saihaj saihaj closed this as completed Oct 28, 2021
@IvanGoncharov IvanGoncharov unpinned this issue Oct 28, 2021
@IvanGoncharov
Copy link
Member Author

Will release defer-stream tomorrow

@IvanGoncharov
Copy link
Member Author

IvanGoncharov commented Oct 29, 2021

Released https://github.com/graphql/graphql-js/releases/tag/v16.0.0-experimental-stream-defer.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants