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

not working with graphql v15 #5

Closed
sibelius opened this issue Apr 13, 2020 · 6 comments
Closed

not working with graphql v15 #5

sibelius opened this issue Apr 13, 2020 · 6 comments
Assignees
Labels
enhancement New feature or request

Comments

@sibelius
Copy link

graphql v15 is more strict about graphql fields

you need to move them to extensions

@mymywang
Copy link

@sibelius Which extensions did you refer to? Could you add link to the doc if there's any? I'm also looking into other options. Thanks!

@sibelius
Copy link
Author

export const getMutationExtensions = (
  info: GraphQLResolveInfo,
  mutationName: string,
): GraphQLFieldConfigMap<any, GraphQLContext> | null => {
  const mutationType = info.schema.getMutationType();
  if (!mutationType) {
    return null;
  }

  const fields = mutationType.getFields();

  return fields[mutationName].extensions;
};

on v14 graphql returned everything inside getFields(), however now, you need to explicit use extensions to store yup schema or something else

@JCMais
Copy link
Owner

JCMais commented Apr 23, 2020

@mymywang it's related to this proposal that was added on GraphQL 15: graphql/graphql-js#1527

I should be able to do something about it this weekend.

@JCMais JCMais self-assigned this Apr 23, 2020
@JCMais JCMais added the enhancement New feature or request label Apr 23, 2020
@JCMais
Copy link
Owner

JCMais commented May 3, 2020

I've pushed graphql-yup-middleware@next as a pre-release version with support for the extensions field, the readme was updated accordingly. Anyone is welcome to test it and post feedback here.

@jgcmarins
Copy link

That's awesome!
I'll give a try ASAP and bring feedback.

@JCMais
Copy link
Owner

JCMais commented Jan 24, 2021

[email protected] has been released with support to (only) GraphQL v15 using the extensions field.

@JCMais JCMais closed this as completed Jan 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants