-
-
Notifications
You must be signed in to change notification settings - Fork 569
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
pgQuery for field
returning enum
fails
#1601
Comments
You’re probably right; we probably did an isScalarType check rather than isLeafType. Fancy hunting it down? |
Point me in the right direction and I'll give it a go. I've not worked with the repo source before so that would be helpful. (I'm unable to find that error message in source in this repo) |
Looks like the error message exists in the
Not 100% sure that's working correctly since I'm getting a I leave the actual fix and test(s) in your wheelhouse. This is a pretty considerable bug given that it effects enums with core functionality. |
Have added this caveat to the docs: graphile/graphile.github.io@ea18be8 |
@benjie has this issue and associated fix been considered for v5? |
I’ve not checked if v5 has this issue, but I doubt it does because it’s built in a completely different way. |
No longer relevant because V5 works in a different way (and thus this issue almost certainly doesn't exist in V5). |
Summary
I think this is a bug. When we use
makeExtendSchema
to extend a type, and attempt to return an enum, we get the error:Error: @pgQuery(...) directive called with invalid arguments - for a table value, call it with 'source' for a scalar with 'fragment'!
I'm having a hard time parsing this message, it's not very clear and could use some improvement. I also can't tell how it relates to my declaration below, or what the resolution is. Have we discovered a new bug?
Steps to reproduce
We've got a TS enum defined as:
And the same declared in GraphQL:
With a field declared as:
Expected results
Server starts and creates schema successfully
Actual results
Error: @pgQuery(...) directive called with invalid arguments - for a table value, call it with 'source' for a scalar with 'fragment'!
Additional context
Of note, if we change
Severity!
toString!
the server starts without issue.Please let me know if you need any additional information or schema, resolver code, etc.
Possible Solution
n/a
The text was updated successfully, but these errors were encountered: