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

Example for InputObject type #45

Closed
millerjs opened this issue Nov 23, 2015 · 6 comments
Closed

Example for InputObject type #45

millerjs opened this issue Nov 23, 2015 · 6 comments

Comments

@millerjs
Copy link

It seems that there is support for the InputObject type defined in the spec, however, none of the examples cover its usage as an argument. Is this supported? If so, is it possible to add an example?

@syrusakbary
Copy link
Member

Hi @millerjs!

I've just added an example of how to use InputObjectType.
It's in examples/complex_example.py.

Hope it helps! :)

@millerjs
Copy link
Author

Thanks! Your example is as expected, however when I plug it in to a more complex schema, I get a TypeError: Cannot read property 'types' of undefined from graphiql. The example is helpful though, thanks!

@syrusakbary
Copy link
Member

@millerjs open an issue with a example that replicates the error (query and maybe the some similar ObjectTypes used in the query) so I can take a look into it! (the more info I have the better for fixing it!)

@millerjs
Copy link
Author

Will do, I figure it's just a misuse on my part. If it turns out not to be, I'll open that issue.

@millerjs
Copy link
Author

The reason it did not work for me is because the InputObject class was defined in a function local scope (I'm generating ObjectTypes classes at runtime).

@syrusakbary
Copy link
Member

You have a detailed log where this error was triggering? (file, line)
Could be very useful for adding more feedback to the developer in future cases by raising a custom detailed exception :)

ronachong pushed a commit to ronachong/graphene that referenced this issue Nov 3, 2017
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