-
Notifications
You must be signed in to change notification settings - Fork 61
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
Fix WithDescendants union type regression in scaffolding #215
Comments
@unclecheese Just to minimise confusion here, could you validate my assumptions here?
|
Workaround for this in open-sausages@6dcc005 |
Demo of the current issue in graphql.yml SilverStripe\Control\Director:
rules:
'graphql': '%$SilverStripe\GraphQL\Controller.default'
SilverStripe\GraphQL\Manager:
schemas:
default:
scaffolding:
types:
Page:
fields: '*'
operations:
read: true
SilverStripe\ErrorPage\ErrorPage:
fields: [ErrorCode] query readPages {
readPages {
edges {
node {
Title
ErrorCode
}
}
}
} Response {
"data": null,
"errors": [
{
"message": "Cannot query field \"ErrorCode\" on type \"Page\".",
"locations": [
{
"line": 6,
"column": 9
}
]
}
]
} |
This doesn't work either graphql.yml SilverStripe\Control\Director:
rules:
'graphql': '%$SilverStripe\GraphQL\Controller.default'
SilverStripe\GraphQL\Manager:
schemas:
default:
scaffolding:
types:
Page:
fields: [Title,ErrorCode]
operations:
read: true
SilverStripe\ErrorPage\ErrorPage:
fields: [ErrorCode] Response {
"errors": [
{
"message": "Invalid field \"ErrorCode\" on Page",
"code": 0,
"file": |
I was questioning wat the current way of working with descendants is, or if there is an alternative to Using the union method as described in the readme section results in the following error: I'm asking here because i'm not quite sure what to do, and if this is still a work in progress should the readme be updated stating that it is a WIP feature? |
The docs say that you get
<type>WithDescendants
, but you don't. It's unclear when that happend, but it's a regression which versioned-admin and elemental now rely on. They can't just change their query to use descendant based logic, because that would force them to dynamically create those queries (based on the available types in a particular SilverStripe project).We could fix this through #209 (RFC: Replace "descendant unions" with fields to simplify querying), but that seems like a long time to leave this regression in the module.
This has also come up with devs on the #graphql channel just now
The text was updated successfully, but these errors were encountered: