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

Fields seem to be missing #1

Closed
EarthlingDavey opened this issue Apr 24, 2019 · 3 comments
Closed

Fields seem to be missing #1

EarthlingDavey opened this issue Apr 24, 2019 · 3 comments

Comments

@EarthlingDavey
Copy link

EarthlingDavey commented Apr 24, 2019

Expected Behavior

An attributes field is available on blocks

Current Behavior

The only fields available are

isValid
name
originalContent
innerBlocks

Steps to Reproduce

  1. Install WP GraphQL, WP GraphQL Gutenberg & WP GraphiQL
  2. Edit and update the only post
  3. Explore using GraphiQL

image

Context

A fresh install no other plugins, on dev environment, WordPress fpm and nginx.

I'm available on https://wp-graphql.slack.com ( join ) if I can be of any help. Thanks,

@pristas-peter
Copy link
Owner

You have to query like this:

{
  posts(first: 2) {
    edges {
      node {
        content
        blocks {
          isValid
          ... on CoreParagraphBlock {
            attributes {
              ... on CoreParagraphBlockAttributesV3 {
                align
                dropCap
                backgroundColor
              }
            }
          }
        }
      }
    }
  }
}

@pristas-peter
Copy link
Owner

@DaveyBrown I will explain the V2, V3 suffix in README (it's due to breaking changes in deprecations and there is no another way how to type this correctly).

@EarthlingDavey
Copy link
Author

Awesome, thank you!

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

No branches or pull requests

2 participants