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

Type names validations #170

Closed
fokot opened this issue Jan 23, 2020 · 3 comments · Fixed by #274
Closed

Type names validations #170

fokot opened this issue Jan 23, 2020 · 3 comments · Fixed by #274
Labels
enhancement New feature or request server Issue related to caliban server

Comments

@fokot
Copy link
Contributor

fokot commented Jan 23, 2020

You can write output type like case class XXXInput and input type case class XXX which would produce invalid schema. Graphiql will fail on this.

Also another possible error is having two output types with same name from different packages which will result in error that the first type is used in Schema, so graphiql does not report error but wrong type is there and it will fail when executing request if I use field which is present in first type but not in second.

@ghostdogpr ghostdogpr added enhancement New feature or request help wanted labels Jan 24, 2020
@ghostdogpr
Copy link
Owner

I agree some kind of check would be useful. The question is at which point do we perform that check and how do we report the problem. Most functions for building and combining apis are pure and without effects. The one that’s effectful is run for each request so it’s not ideal for this.

@ghostdogpr
Copy link
Owner

Since #227 , we now validate the schema when calling .interpreter. So we have a place to implement these checks.

@ghostdogpr
Copy link
Owner

Working on this.

@ghostdogpr ghostdogpr added server Issue related to caliban server core labels Sep 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request server Issue related to caliban server
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants