Skip to content
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

Draft
wants to merge 13 commits into
base: main
Choose a base branch
from
Draft

Introduce Lookup Directive. #30

wants to merge 13 commits into from

Conversation

michaelstaib
Copy link
Member

@michaelstaib michaelstaib commented Apr 11, 2024

This PR renames the @entityReslolver to @lookup and introduces the agreed characteristics to the specification.

TODOs:

  • Semantics of lookups vs patches RFC document (Michael).

Copy link
Member

@benjie benjie left a 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") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
type Person @key(fields "id") @key(fields "name") {
type Person @key(fields: "id") @key(fields: "name") {

}

interface Node {
interface Node @key(fields "id") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
interface Node @key(fields "id") {
interface Node @key(fields: "id") {

}

union Entity = Cat | Dog

extend type Dog {
type Dog @key(fields "id categoryId") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
type Cat @key(fields "id") {
type Cat @key(fields: "id") {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants