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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

GraphQLUpload scalar implementation #213

Closed
vekonylaszlo opened this issue Nov 12, 2021 · 2 comments
Closed

GraphQLUpload scalar implementation #213

vekonylaszlo opened this issue Nov 12, 2021 · 2 comments

Comments

@vekonylaszlo
Copy link

Hey馃憢

I'm trying to create a file upload mutation based on the ApolloGraphQL documentation.
I can't figure out, how should I map the GraphQLUpload to the Upload scalar.

In the builder file, I added a new scalar like this:

Scalars: {
    ...
    Upload: { Input: Upload; Output: Upload; }
  };

And then i tried to add the GraphQLUpload like this:

builder.addScalarType("Upload", GraphQLUpload, {});

But I get an error message:
Argument of type 'GraphQLScalarType' is not assignable to parameter of type 'GraphQLScalarType<unknown, unknown>'. Type 'GraphQLScalarType' is missing the following properties from type 'GraphQLScalarType<unknown, unknown>': specifiedByURL, [Symbol.toStringTag]

Can you give me a hint on how should I solve this?
Thank you very much!

@hayes
Copy link
Owner

hayes commented Nov 12, 2021

My guess is you have two copies of graphql in your dependency graph.

This issue is probably related: graphql/graphql-js#3156

I would highly recommend using resolutions (if you are using yarn or pnpm) to ensure you only have 1 version of graphql

@vekonylaszlo
Copy link
Author

You were right! Thank you for helping out!

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

2 participants