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

<SliceZone> does not work with GraphQL API responses #139

Closed
angeloashmore opened this issue Mar 30, 2022 · 1 comment
Closed

<SliceZone> does not work with GraphQL API responses #139

angeloashmore opened this issue Mar 30, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@angeloashmore
Copy link
Member

<SliceZone> expects a list of Slice objects to render, each with a slice_type property. This property is used to determine which component to render.

Prismic's GraphQL API uses the type field rather than slice_type. The component should be updated to support the GraphQL-style object.

Versions

  • @prismicio/react: v2.1.2
  • react: 17.0.2
  • node: 14.x

Steps to reproduce

  1. Query a Slice Zone from the GraphQL API. Include the type field.
  2. Send that data to <SliceZone>
  3. See that it cannot determine the Slice's type.

What is expected?

It works the same as when querying content from the Rest API.

What is actually happening?

It does not render the correct component for each Slice.

@angeloashmore angeloashmore added the bug Something isn't working label Mar 30, 2022
@angeloashmore
Copy link
Member Author

Fixed in #141

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant