Commit e91f5fa
committed
The bundled directive declarations restricted @canonical, @hidden, and
@renamed to OBJECT only, causing local SDL validation to reject schemas
that apply them to fields. AWS's Merged API spec and best-practices
documentation explicitly support FIELD_DEFINITION usage, e.g.:
rating: Int @canonical
authorId: ID! @hidden
getMessage(id: ID!): Message @renamed
Widen the location set to OBJECT | FIELD_DEFINITION.
Note: AWS's @renamed directive also takes a `to: String!` argument
(e.g. `@renamed(to: "newName")`). Adding it to this stub would break
existing users who write `@renamed` without an argument, so it is left
out of this change. See PR description for details.
Refs: https://aws.amazon.com/blogs/mobile/aws-appsync-merged-apis-best-practices-part-2-schema-composition/
1 parent 8f165c3 commit e91f5fa
3 files changed
Lines changed: 35 additions & 3 deletions
File tree
- src
- __tests__
- fixtures/schemas/merge-directives
- resources
Lines changed: 20 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
156 | 168 | | |
157 | 169 | | |
158 | 170 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | | - | |
23 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
0 commit comments