-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce Lookup Directive. #30
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's more missing colons I've missed.
} | ||
|
||
extend type Person { | ||
id: ID! # matches the argument of personById | ||
type Person @key(fields "id") @key(fields "name") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
type Person @key(fields "id") @key(fields "name") { | |
type Person @key(fields: "id") @key(fields: "name") { |
} | ||
|
||
interface Node { | ||
interface Node @key(fields "id") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interface Node @key(fields "id") { | |
interface Node @key(fields: "id") { |
} | ||
|
||
union Entity = Cat | Dog | ||
|
||
extend type Dog { | ||
type Dog @key(fields "id categoryId") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
type Dog @key(fields "id categoryId") { | |
type Dog @key(fields: "id categoryId") { |
id: ID! | ||
categoryId: Int | ||
} | ||
|
||
extend type Cat { | ||
type Cat @key(fields "id categoryId") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
type Cat @key(fields "id categoryId") { | |
type Cat @key(fields: "id categoryId") { |
field `Query.personById` and the field `Person.id` on the return type of the | ||
field are semantically the same. This information is used to infer an entity | ||
resolver for `Person` from the field `Query.personById`. | ||
type Dog @key(fields "id categoryId") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
type Dog @key(fields "id categoryId") { | |
type Dog @key(fields: "id categoryId") { |
```graphql example | ||
extend type Query { | ||
personById(id: ID! @is(field: "id")): Person @entityResolver | ||
type Cat @key(fields "id") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
type Cat @key(fields "id") { | |
type Cat @key(fields: "id") { |
This PR renames the
@entityReslolver
to@lookup
and introduces the agreed characteristics to the specification.TODOs: