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

Update authorization and pagination docs #1814

Open
wants to merge 5 commits into
base: source
Choose a base branch
from

Conversation

mandiwise
Copy link
Contributor

Description

This PR contains updated authorization and pagination content for the Learn docs. Key changes include:

  • Intro and recap formats are standardized with other updated pages
  • Example resolver format has been standardized with the rest of the docs
  • The postRepository code example has been expanded for clarity
  • Nod to auth directives (given that this is a common pattern)
  • Schema examples for connection and edge types are include on the pagination page
  • Light editing throughout each page

@benjie @jorydotcom

Copy link

vercel bot commented Nov 3, 2024

@mandiwise is attempting to deploy a commit to the The GraphQL Foundation Team on Vercel.

A member of the Team first needs to authorize it.

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.

Some really good changes here, but I'm not sure about "Using type system directives" being included?

src/pages/learn/authorization.mdx Outdated Show resolved Hide resolved
src/pages/learn/pagination.mdx Outdated Show resolved Hide resolved

## Using type system directives

In the example above, we saw how authorization logic can be delegated to the business logic layer through a function that is called in a field resolver.
Copy link
Member

@benjie benjie Nov 22, 2024

Choose a reason for hiding this comment

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

Following on from https://github.com/graphql/graphql.github.io/pull/1814/files#r1852923240

Instead of trying to fit the auth directive approach into the "business logic layer" narrative, let's explicitly call it out as an alternative - something that people do but is not the recommended way:

Suggested change
In the example above, we saw how authorization logic can be delegated to the business logic layer through a function that is called in a field resolver.
In the example above, we saw how authorization logic can be delegated to the business logic layer through a function that is called in a field resolver. In general it is recommended to perform all authorization logic in the business logic layer, however if you decide to implement authorization in the GraphQL layer instead then one approach is to use [type system dire...

(merge with next paragraph)

The remainder of the text in this section would also need light editorial to reflect this.

What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good, addressed in 587906a.

@benjie
Copy link
Member

benjie commented Nov 22, 2024

We're back to 136 files changed @mandiwise; I think something went wrong with your merge/rebase

@mandiwise mandiwise changed the base branch from source to nullability-post November 27, 2024 22:10
@mandiwise mandiwise changed the base branch from nullability-post to source November 27, 2024 22:11
@mandiwise mandiwise closed this Nov 27, 2024
@mandiwise
Copy link
Contributor Author

mandiwise commented Nov 27, 2024

@benjie I tried to sync my fork's branch with source before fixing the commit history issue and something went haywire in Github and it auto-closed this PR. I can't reopen the PR, so let me know if you can do this from your end or if you'd like me to create a new branch. I should have everything we've done so far locally.

Update: I dug into this further was able to figure out what needed to be done for the PR to be re-openable. I was also able to remove the duplicated file changes from the source branch again.

@mandiwise mandiwise reopened this Nov 27, 2024
src/pages/learn/authorization.mdx Outdated Show resolved Hide resolved
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.

This looks good to go to me! 🙌

Copy link

vercel bot commented Nov 28, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
graphql-github-io ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 28, 2024 4:23pm

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