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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support Prismic's GraphQL API in <SliceZone> #141

Merged
merged 1 commit into from Mar 31, 2022

Conversation

angeloashmore
Copy link
Member

Types of changes

  • Chore (a non-breaking change which is related to package maintenance)
  • Bug fix (a non-breaking change which fixes an issue)
  • New feature (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

This PR adds support for Prismic's GraphQL API when using <SliceZone>.

The GraphQL API returns Slices with the following shape:

{
  "type": "foo",
  "label": "bar",
  "primary": {},
  "items": []
}

The Rest API returns Slices with the following shape:

{
  "slice_type": "foo",
  "slice_label": "bar",
  "primary": {},
  "items": []
}

To support the GraphQL API, <SliceZone> can now read a Slice's slice_type or type property to determine which component to render.

Checklist:

  • My change requires an update to the official documentation.
  • All TSDoc comments are up-to-date and new ones have been added where necessary.
  • All new and existing tests are passing.

馃悪

@github-actions
Copy link

size-limit report 馃摝

Path Size
dist/index.js 4.43 KB (+0.31% 馃敽)
dist/index.cjs 6.31 KB (+0.21% 馃敽)

@angeloashmore angeloashmore merged commit 3f774db into master Mar 31, 2022
@angeloashmore angeloashmore deleted the aa/slicezone-graphql branch March 31, 2022 03:00
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

1 participant