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

#441 breaks the use with raw GraphQLScalarType from library such as graphql-upload-minimal #1166

Open
oosawy opened this issue Sep 27, 2023 · 0 comments

Comments

@oosawy
Copy link

oosawy commented Sep 27, 2023

When updating nexus from 1.1.0 to latest, the following error occurs.
And I found out it can no longer use GraphQLScalarType since 1.2.0-next.14 introduced #983

Error: Schema must contain uniquely named types but contains multiple types named "Upload".
    at new GraphQLSchema (/home/projects/stackblitz-starters-gbnfra/node_modules/graphql/type/schema.js:194:15)
    at makeSchemaInternal (/home/projects/stackblitz-starters-gbnfra/node_modules/nexus/dist/builder.js:1153:20)
    at makeSchema (/home/projects/stackblitz-starters-gbnfra/node_modules/nexus/dist/makeSchema.js:16:84)

Reproduction:

https://stackblitz.com/edit/stackblitz-starters-gbnfra?file=package.json,index.js

Workaround:

cxport const FileUpload = scalarType({
  ...GraphQLUpload,
  asNexusMethod: "upload",
})


const Query = queryType({
  definition(t) {
    t.field('account', {
      type: Account,
      args: {
        avatar: arg({ type: FileUpload }),
      },
    })
  },
})
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

1 participant