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
GraphQL errors when querying/mutating models in a non-default module #5985
Labels
Comments
Merged
vpetrovykh
added a commit
that referenced
this issue
Sep 18, 2023
The `__typename` in non-default modules was getting mangled incorrectly. Issue #5985 (a)
vpetrovykh
added a commit
that referenced
this issue
Sep 18, 2023
Using types from non-default module in fragments no longer causes unresolved type error. Issue #5985 (b)
vpetrovykh
added a commit
that referenced
this issue
Sep 18, 2023
Requesting `__typename` for mutations no longer causes an error. Issue #5985 (c)
vpetrovykh
added a commit
that referenced
this issue
Sep 18, 2023
The `__typename` in non-default modules was getting mangled incorrectly. Issue #5985 (a)
vpetrovykh
added a commit
that referenced
this issue
Sep 18, 2023
Using types from non-default module in fragments no longer causes unresolved type error. Issue #5985 (b)
vpetrovykh
added a commit
that referenced
this issue
Sep 18, 2023
Requesting `__typename` for mutations no longer causes an error. Issue #5985 (c)
The fixes are in #6035 |
msullivan
pushed a commit
that referenced
this issue
Sep 21, 2023
The `__typename` in non-default modules was getting mangled incorrectly. Issue #5985 (a)
msullivan
pushed a commit
that referenced
this issue
Sep 21, 2023
Using types from non-default module in fragments no longer causes unresolved type error. Issue #5985 (b)
msullivan
pushed a commit
that referenced
this issue
Sep 21, 2023
Requesting `__typename` for mutations no longer causes an error. Issue #5985 (c)
msullivan
pushed a commit
that referenced
this issue
Sep 27, 2023
The `__typename` in non-default modules was getting mangled incorrectly. Issue #5985 (a)
msullivan
pushed a commit
that referenced
this issue
Sep 27, 2023
Using types from non-default module in fragments no longer causes unresolved type error. Issue #5985 (b)
msullivan
pushed a commit
that referenced
this issue
Sep 27, 2023
Requesting `__typename` for mutations no longer causes an error. Issue #5985 (c)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am experiencing multiple issues while attempting to use the GraphQL query/mutation endpoints whenever a model is part of a non-
default
module. See inline below for specific issues and how to trigger them.Schema
(Untested, but this should reproduce the issues):
Steps to Reproduce
A) Invalid
__typename
for module-scoped model in queryThe response may look something like:
The
__typename
field forchild::Child
does not resolve correctly, and will return\u0001__\u0002_Type
for any type inside a non-default
module. I would expect it to instead returnchild__Child_Type
.This causes issues for regular GraphQL clients, as they rely on the typename to figure out the concrete type returned for the respective interfaces that the query defines as the return type (e.g.
Parent
->Parent_Type
).Note that the
__typename
works as expected for models indefault
.B) Unsupported inline fragment spread for module-scoped model in query
This is a bit more of an edge case, but we use schema stitching to delegate parts of queries to the EdgeDB graph, and it likes to insert these inline fragment spreads for specific types from the given graph. This syntax results in a flat-out error from EdgeDB:
AssertionError: unresolved type std::child__Child
This syntax works fine for models in the
default
module.C) Mutation fails if
__typename
is requested for a module-scoped selectionSimply the presence of
__typename
in the selection set (which is added automatically by tooling in order to glean the concrete type for an interface) causes an error from EdgeDB:AttributeError: 'NoneType' object has no attribute 'dummy'
Again, this works fine, and the correct type (e.g.
Parent_Type
) is returned for a mutation on a model indefault
. Data is also returned without an error if removing__typename
from the selection set.Workaround
As a workaround, for now, I have just lifted everything into the
default
module - but this is a disappointing solution, and hopefully, there are actual bugs here that can be tracked down! It's worth noting that all of these issues disappear when the models are all indefault
.Thanks for taking a look - we love EdgeDB, and the dev team is awesome! If you are unable to repro, let me know, and I can try to figure out the specific combination of properties that triggered this behavior for me.
The text was updated successfully, but these errors were encountered: