Why does having categories as a field name errors out?
Open
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 6k
- Forks
- 516
- PR merge metrics
- No merged PRs in 30d
Description
I have the query below with categories as the field name
right now i renamed it to test and it works fine
but doing so with categories
would throw an error that it's undefined
why?
apollo: {
plant: {
query: gql`
query Plant($id: ID) {
plant(id: $id) @client {
id
commonName
scientificName
maxHeight
nativeTo
growingArea
growingRate
sunlightRequirement
waterRequirement
prices {
id
gallon
size
price
}
test: categories {
id
name
}
}
}
`,
variables() {
return {
id: this.id
}
}
}
}
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.
Research direction
Start by reproducing the Apollo query shown in the issue, comparing the direct categories field with the test: categories alias. Trace how the client handles the categories selection and capture the resulting error; done means identifying the cause and documenting or correcting the behavior, with a regression test if the repository provides a relevant test entry point.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- graphql, javascript
- Domain
- api, frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100