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

Change Input Type name #389

Open
papatego opened this issue Apr 6, 2021 · 1 comment
Open

Change Input Type name #389

papatego opened this issue Apr 6, 2021 · 1 comment

Comments

@papatego
Copy link

papatego commented Apr 6, 2021

I'm defining a sort parameter in multiple get requests in different spec files. When generating the schemas, I get:

    Error: Schema must contain uniquely named types but contains multiple types named "SortInput".
        at typeMapReducer (/Users/amansouri/repos/voxsupFrontend2/services/graphql/node_modules/graphql/type/schema.js:262:13)
        at typeMapReducer (/Users/amansouri/repos/voxsupFrontend2/services/graphql/node_modules/graphql/type/schema.js:293:20)
        at Array.reduce (<anonymous>)
        at typeMapReducer (/Users/amansouri/repos/voxsupFrontend2/services/graphql/node_modules/graphql/type/schema.js:285:34)
        at Array.reduce (<anonymous>)
        at new GraphQLSchema (/Users/amansouri/repos/voxsupFrontend2/services/graphql/node_modules/graphql/type/schema.js:145:28)
        at SchemaComposer.buildSchema (/Users/amansouri/repos/voxsupFrontend2/services/graphql/node_modules/graphql-compose/lib/SchemaComposer.js:130:12)
        at _callee$ (/Users/amansouri/repos/voxsupFrontend2/services/graphql/src/modules/uam/index.js:100:33)
        at tryCatch (/Users/amansouri/repos/voxsupFrontend2/services/graphql/node_modules/regenerator-runtime/runtime.js:45:40)
        at Generator.invoke [as _invoke] (/Users/amansouri/repos/voxsupFrontend2/services/graphql/node_modules/regenerator-runtime/runtime.js:274:22)
        at Generator.prototype.<computed> [as next] (/Users/amansouri/repos/voxsupFrontend2/services/graphql/node_modules/regenerator-runtime/runtime.js:97:21)
        at asyncGeneratorStep (/Users/amansouri/repos/voxsupFrontend2/services/graphql/dist/modules/uam/index.js:70:103)
        at _next (/Users/amansouri/repos/voxsupFrontend2/services/graphql/dist/modules/uam/index.js:72:194)
        at processTicksAndRejections (internal/process/task_queues.js:93:5)

Is there a way I can change the input name here ?

@Alan-Cha
Copy link
Collaborator

Alan-Cha commented Apr 7, 2021

@papatego Sorry for the trouble. I believe OtG should append a number to the end of conflicting names so I am confused why this is occurring.

You can try printing out the schema to identify the problematic types and the corresponding schemas. Perhaps the equivalentToMessages option will help. If you are willing to make changes to the OAS, you can try to change the name of the input object but it depends on how the schema is referenced (for example, if it is a referenced component schema or not).

We are currently working on #379 which would give users complete control over naming.

If you can provide the OAS or a subset of it, we can look into debugging this issue.

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