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

"Full data" GraphQL mode for Link fields #16237

Merged
merged 1 commit into from
Nov 28, 2024
Merged

"Full data" GraphQL mode for Link fields #16237

merged 1 commit into from
Nov 28, 2024

Conversation

brandonkelly
Copy link
Member

Description

Adds a “GraphQL Mode” setting to Link fields, with the options “Full data” and “URL only”.

“Full data” will be selected by default for new Link fields; “URL only” will be selected by default for existing Link fields (for backwards compatibility on existing GraphQL APIs).

When “Full data” is selected, Link fields will be represented in GraphQL as objects with the following sub-fields:

  • type
  • value
  • label
  • urlSuffix
  • url
  • elementType
  • elementId
  • elementSiteId
  • elementTitle

For mutating Link field values, an object will need to be passed with the following sub-fields:

  • type (set to a valid link type ID, e.g. url or entry)
  • value (set to the URL or element reference tag)
  • label (optional)
  • urlSuffix (optional)

Screenshot of GraphiQL in Craft CMS, updating a Link field value.

Related issues

@brandonkelly brandonkelly merged commit aa4f521 into 5.6 Nov 28, 2024
3 checks passed
@brandonkelly brandonkelly deleted the feature/link-gql branch November 28, 2024 14:47
brandonkelly added a commit that referenced this pull request Nov 28, 2024
@brandonkelly brandonkelly mentioned this pull request Dec 2, 2024
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.

1 participant