You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: spec/Section 4 -- Composition.md
+21-17Lines changed: 21 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -6200,21 +6200,25 @@ schemas can handle that field at each step.
6200
6200
- While {queue} is not empty:
6201
6201
- Dequeue a tuple ({currentType}, {currentPath}, {currentOptions}).
6202
6202
- If ({currentType}, {currentOptions}) is in {visitedStates}, continue to
6203
-
the next tuple in {queue}.
6203
+
the next tuple in {queue}. #TODO This does not take into consideration the case where we have already visited this type with a subset of currentOptions.
6204
6204
- Add ({currentType}, {currentOptions}) to {visitedStates}.
6205
6205
- Let {fields} be the set of fields on {currentType} in {schema}.
6206
6206
- For each {field} in {fields}:
6207
6207
- Let {returnType} be the return type of {field}.
6208
-
- For each {possibleType} in {returnType}:
6209
-
- Let {newPath} be {currentPath} extended by {field} with
6210
-
{possibleType}, for example `<currentPath>.<fieldName><possibleType>`.
6211
-
- Let {newOptions} be {PlanOptions(newPath)}
6212
-
- If {newOptions} is empty, the schema is unsatisfiable and composition
6213
-
fails.
6214
-
- If {field} returns a scalar or enum (a leaf type), continue to the
6215
-
next {possibleType}.
6216
-
- Otherwise, enqueue the tuple ({possibleType}, {newPath}, {newOptions})
6217
-
into {queue}.
6208
+
- If {returnType} is a leaf type
6209
+
- Let {newPath} be {currentPath} extended by {field}, for example `<currentPath>.<fieldName>`.
6210
+
- Let {newOptions} be {PlanOptions(newPath)}
6211
+
- If {newOptions} is empty, the schema is unsatisfiable and composition
6212
+
fails.
6213
+
- Otherwise
6214
+
- For each {possibleType} in {returnType}:
6215
+
- Let {newPath} be {currentPath} extended by {field} with
6216
+
{possibleType}, for example `<currentPath>.<fieldName><possibleType>`.
6217
+
- Let {newOptions} be {PlanOptions(newPath)}
6218
+
- If {newOptions} is empty, the schema is unsatisfiable and composition
6219
+
fails.
6220
+
- Otherwise, enqueue the tuple ({possibleType}, {newPath}, {newOptions})
6221
+
into {queue}.
6218
6222
6219
6223
- If the entire process completes for all {roots} without encountering an empty
6220
6224
{newOptions}, the schema is satisfiable.
@@ -6235,7 +6239,7 @@ type Profile {
6235
6239
}
6236
6240
6237
6241
typeUser {
6238
-
id: ID!
6242
+
id: ID!@shareable
6239
6243
name: String
6240
6244
}
6241
6245
@@ -6250,7 +6254,7 @@ type Order {
6250
6254
}
6251
6255
6252
6256
typeUser {
6253
-
id: ID!
6257
+
id: ID!@shareable
6254
6258
membershipStatus: String
6255
6259
}
6256
6260
```
@@ -6312,7 +6316,7 @@ sources, but there is no consistent lookup path that includes all required
6312
6316
fields. While, when the query first retrieves a product from schema Product
6313
6317
(knowing `sku`) it can move to Inventory via `id`, there is no valid path if the
6314
6318
query starts from Inventory’s `productById` to Product’s `productByIdSku`.
6315
-
{PlanOptions} with `<Query>.productByIdSku<Product>.name` wouldreturnanempty
6319
+
{PlanOptions} with `<Query>.productById<Product>.name` wouldreturnanempty
0 commit comments