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

Schema validation should refuse inputs which are not of type inputType #154

Closed
1 task done
ultrabug opened this issue Mar 12, 2019 · 2 comments · Fixed by #157
Closed
1 task done

Schema validation should refuse inputs which are not of type inputType #154

ultrabug opened this issue Mar 12, 2019 · 2 comments · Fixed by #157
Assignees
Labels
bug Something isn't working
Milestone

Comments

@ultrabug
Copy link

  • Tartiflette version: 0.6.5

While working on a project I made a mistake in a Mutation where I referenced an Object Type as an Input Type and the engine started normally.

Then when trying to use this I got:

✔ Loading Apollo Project 
✖ Saving schema to schema.json 
→ Introspection must provide input type for arguments, but received: AuthenticationType!. Error: Introspection must provide input type for arguments, but received: AuthenticationType!. at invariant (/usr/local/lib/node_modules/apollo/node_modules/graphql/jsutils/invariant.js:19:11) at getInputType (/usr/local/lib/node_modules/apollo/node_modules/graphql/utilities/buildClientSchema.js:115:66) at buildInputValue (/usr/local/lib/node_modules/apollo/node_modules/graphql/utilities/buildClientSchema.js:275:16) at /usr/local/lib/node_modules/apollo/node_modules/graphql/jsutils/keyValMap.js:36:31 at Array.reduce (<anonymous>) at keyValMap (/usr/local/lib/node_modules/apollo/node_modules/graphql/jsutils/keyValMap.js:35:15) at buildInputValueDefMap (/usr/local/lib/node_modules/apollo/node_modules/graphql/utilities/buildClientSchema.js:269:35) at /usr/local/lib/node_modules/apollo/node_modules/graphql/utilities/buildClientSchema.js:263:15 at /usr/local/lib/node_modules/apollo/node_modules/graphql/jsutils/keyValMap.js:36:31 at Array.reduce (<anonymous>)

So I guess we should validate that objects referenced as inputs are of type inputType and raise an error if that's not the case

Thanks!

@abusi abusi self-assigned this Mar 13, 2019
@abusi abusi added the bug Something isn't working label Mar 13, 2019
@abusi abusi added this to the road-to-v1 milestone Mar 13, 2019
@abusi
Copy link
Contributor

abusi commented Mar 13, 2019

Thank you for this report, i'll work on this quickly.

@ultrabug
Copy link
Author

Thanks @abusi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants