GraphQL inline fragments not required?
Open
@andris-sevcenko is already working on this.
Since Nov 23, 2020.
bug
graphql :gear:
- Dominant language
- PHP
- Stars
- 3.6k
- Forks
- 705
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 134
Description
Description
In GraphQL I seem to be able to access custom fields on entries without inline fragments. Is this a bug or a feature?
Currently this query returns the correct data without error:
entries {
customField
}
However as far as I can tell, the inline fragment should be required:
entries {
...on section_entrytype_Entry {
customField
}
}
While I think this is currently a bug, it is actually quite useful as the site has many entry types with shared custom fields which would result in a huge query similar but multiple times larger than:
entries {
...on section_entrytype1_Entry {
customField1
customField2
customField3
}
...on section_entrytype2_Entry {
customField1
customField2
customField3
}
...on section_entrytype3_Entry {
customField1
customField2
customField3
}
}
Additional info
- Craft version: 3.5.14
- PHP version: 7.3.19
- Database driver & version: MySQL 8.0.20
- Plugins & versions:
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.