adds first version of satisfiability#185
Draft
PascalSenn wants to merge 6 commits intomainfrom
Draft
Conversation
✅ Deploy Preview for composite-schemas ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
glen-84
suggested changes
Apr 10, 2025
| # Schema ProductIndex | ||
| type Query { | ||
| productById(id: ID!): Product @lookup | ||
| productBySku(sku: ID!): Product @lookup |
Contributor
There was a problem hiding this comment.
Suggested change
| productBySku(sku: ID!): Product @lookup | |
| productBySku(sku: String!): Product @lookup |
| ``` | ||
|
|
||
| will attempt to retrieve `country` from User’s version of `Address`. But because | ||
| `Address` is not an entity, there is no `@lookup` to fetch that field to schema |
Contributor
There was a problem hiding this comment.
Suggested change
| `Address` is not an entity, there is no `@lookup` to fetch that field to schema | |
| `Address` is not an entity, there is no `@lookup` to fetch that field from schema |
Comment on lines
+6455
to
+6457
| To resolve this, both schemas would need to align on the `Address` type either | ||
| both define `country` or neither does or turn `Address` into an entity with some | ||
| form of bridging lookup. As it stands, the mismatch in value-type fields across |
Contributor
There was a problem hiding this comment.
Suggest reworking this sentence. Seems awkward.
|
|
||
| In the Products schema, `Category` is simply a nested value type. There is no | ||
| `@lookup` field or key to identify it, and `Product.category` does not provide | ||
| an ID or other identifier. By contrast, the Categories schema, treats `Category` |
Contributor
There was a problem hiding this comment.
Suggested change
| an ID or other identifier. By contrast, the Categories schema, treats `Category` | |
| an ID or other identifier. By contrast, the Categories schema treats `Category` |
| Product schema (including its `Category`), but this schema never provides an ID | ||
| for that category. In effect, the executor cannot lookup the `Category` from the | ||
| categories schema, so that `description` can be fetched. The result of | ||
| {PlantOptions()} with `<Query>.productById<Product>.category<Category>.name` is |
Contributor
There was a problem hiding this comment.
Suggested change
| {PlantOptions()} with `<Query>.productById<Product>.category<Category>.name` is | |
| {PlanOptions()} with `<Query>.productById<Product>.category<Category>.name` is |
| It is not required that every schema define a `@lookup` for a shared entity as | ||
| long all fields are covered by a schema that has a lookup. In the example below, | ||
| the `Order` schema references `User` but does not provide a `@lookup` for it. | ||
| Instead, it marks the `User.id` field as `@shareable` (or could have used |
Contributor
There was a problem hiding this comment.
The User.id field is not marked as @shareable.
Co-authored-by: Glen <glen.84@gmail.com>
Co-authored-by: Glen <glen.84@gmail.com>
Co-authored-by: Glen <glen.84@gmail.com>
glen-84
reviewed
Apr 14, 2025
| ** Entity vs. Value Type Conflict** | ||
|
|
||
| ```graphql counter-example | ||
| ## Schema Products |
Contributor
There was a problem hiding this comment.
Suggested change
| ## Schema Products | |
| # Schema Products |
glen-84
reviewed
Apr 14, 2025
| name: String | ||
| } | ||
|
|
||
| ### Schema Categories |
Contributor
There was a problem hiding this comment.
Suggested change
| ### Schema Categories | |
| # Schema Categories |
glen-84
reviewed
Apr 14, 2025
| for that entity. | ||
|
|
||
| ```graphql | ||
| # Schema: Order |
Contributor
There was a problem hiding this comment.
Suggested change
| # Schema: Order | |
| # Schema Order |
glen-84
reviewed
Apr 14, 2025
| name: String | ||
| } | ||
|
|
||
| # Schema: User |
Contributor
There was a problem hiding this comment.
Suggested change
| # Schema: User | |
| # Schema User |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a first version of satisfiability