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 operation docs #1802

Merged
merged 26 commits into from
Nov 25, 2024
Merged

Update operation docs #1802

merged 26 commits into from
Nov 25, 2024

Conversation

mandiwise
Copy link
Contributor

Addresses #250, #584, #728, #754, and #992

Description

This PR contains updated operations-related content in the Learn docs. Key changes include:

  • Expanded content on GraphQL query operations
  • A separate "Mutations" page with additional examples for updating and deleting data
  • A new "Subscriptions" page
  • Updates to the Star Wars schema to support the new mutation examples
  • Operation-related content now comes after the Schemas and Types page in the left nav
  • Standardization of capitalization and naming for named types

@benjie @jorydotcom

Copy link

vercel bot commented Oct 26, 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

vercel bot commented Oct 27, 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 22, 2024 8:53am

Copy link
Contributor

@Urigo Urigo left a comment

Choose a reason for hiding this comment

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

so excited for this!


## Deleting data

Just as we can send a `DELETE` request to delete a resource with a REST API, we can use mutations to delete some existing data as well by defining another field on the `Mutation` type:
Copy link
Member

Choose a reason for hiding this comment

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

I think we should clarify that in GraphQL we send a POST request to delete

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have an updated "Serving over HTTP" page almost ready to go where I go into this in detail based on the draft GraphQL over HTTP spec (including when GET may be used too). Does it make sense to duplicate that here? My goal was draw connections with REST patterns the reader would likely be familiar with while explaining how different kinds of mutations work without overloading with too much information. It can be tricky to find the right balance though! Let me know what you think.

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.

I love the improvements to the queries page (and include a number of minor suggested edits), but I have concerns over the mutations page. I have not yet read the subscriptions page.

src/pages/learn/queries.mdx Outdated Show resolved Hide resolved
src/pages/learn/queries.mdx Outdated Show resolved Hide resolved
src/pages/learn/queries.mdx Show resolved Hide resolved
src/pages/learn/queries.mdx Outdated Show resolved Hide resolved
src/pages/learn/queries.mdx Outdated Show resolved Hide resolved
src/pages/learn/queries.mdx Outdated Show resolved Hide resolved
src/pages/learn/queries.mdx Outdated Show resolved Hide resolved
src/pages/learn/queries.mdx Outdated Show resolved Hide resolved
src/pages/learn/mutations.mdx Outdated Show resolved Hide resolved
src/pages/learn/mutations.mdx Outdated Show resolved Hide resolved
Co-authored-by: Benjie <benjie@jemjie.com>
@benjie
Copy link
Member

benjie commented Nov 21, 2024

Not quite sure what happened here but it went to 136 files changed... I've merged in the latest source and resolved the conflicts... That seems to have us back down to 5 files changed.

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.

I like this new structure and this is great content - really really good! I've included some minor nit-picky suggestions below - the only big change I think is that it would be nice to see the purpose-driven mutations content raised to be its own heading so it's easy to link to, and doing so may or may not require some minor reworking of the surrounding text.

src/pages/learn/subscriptions.mdx Outdated Show resolved Hide resolved
src/pages/learn/subscriptions.mdx Outdated Show resolved Hide resolved
src/pages/learn/subscriptions.mdx Outdated Show resolved Hide resolved
src/pages/learn/subscriptions.mdx Outdated Show resolved Hide resolved
src/pages/learn/subscriptions.mdx Outdated Show resolved Hide resolved
src/pages/learn/mutations.mdx Outdated Show resolved Hide resolved
src/pages/learn/mutations.mdx Outdated Show resolved Hide resolved
src/pages/learn/mutations.mdx Outdated Show resolved Hide resolved
src/pages/learn/mutations.mdx Outdated Show resolved Hide resolved
src/pages/learn/mutations.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.

Looks great to me!

@benjie benjie merged commit 0fc56e6 into graphql:source Nov 25, 2024
4 checks passed
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.

8 participants