aws-amplify / aws-amplify/amplify-codegen
Do we fully support fragments?
- Dominant language
- TypeScript
- Stars
- 59
- Forks
- 64
- PR merge metrics
- No merged PRs in 30d
Description
** Which Category is your question related to? **
GraphQL transformer codegen
** Provide additional details e.g. code snippets **
I'm adding a fragment in a custom GraphQL query file. For example:
```
fragment SheetParts on Sheet {
id,
name,
bpm,
}
query ListItemPage($id: ID!) {
getList(id: $id) {
name,
sheets {
items {
...SheetParts
}
}
}
}
query MyLibraryPage($limit: Int, $nextToken: String) {
listSheets(limit: $limit, nextToken: $nextToken) {
nextToken,
items {
...SheetParts
}
}
}
```
Codegen gracefully generates SheetPartsFragment into my API, but when requesting the qery through the generated API, I get this error:
`core.js:15724 ERROR Error: Uncaught (in promise): Object: {"data":null,"errors":[{"path":null,"locations":[{"line":9,"column":9,"sourceName":null}],"message":"Validation error of type UndefinedFragment: Undefined fragment SheetParts @ 'getList/sheets/items'"}]}`
Am I missing something?
Thanks
Contributor guide
Assessment
This issue has not been assessed yet.