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

namespaced directive ISO #2266 #2469

Merged
merged 2 commits into from
Nov 28, 2023
Merged

namespaced directive ISO #2266 #2469

merged 2 commits into from
Nov 28, 2023

Conversation

sniper7kills
Copy link
Contributor

Helps to address #2266 in the main package without users having to create a custom field resolver.

  • Added or updated tests
  • [ X ] Documented user facing changes
  • Updated CHANGELOG.md

Changes

Adds a @namespaced directive; allowing mutations and queries to be posted.

Allows:

type Mutation {
    createPost(input: CreatePostInput! @spread): Post! @create
    updatePost(input: UpdatePostInput! @spread): Post! @update
    deletePost(input: DeletePostInput! @spread): Post @delete
}

to become:

type Mutation {
    posts: PostMutations! @namespaced
}

type PostMutations {
    create(input: CreatePostInput! @spread): Post! @create
    update(input: UpdatePostInput! @spread): Post! @update
    delete(input: DeletePostInput! @spread): Post @delete
}

ref: https://www.apollographql.com/docs/technotes/TN0012-namespacing-by-separation-of-concern/

@spawnia spawnia merged commit b086f46 into nuwave:master Nov 28, 2023
10 of 22 checks passed
@spawnia
Copy link
Collaborator

spawnia commented Nov 28, 2023

I like the naming and docs, but I merged prematurely. I think the example will not work as is, this feature needs tests.

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.

2 participants