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

【contentful】Enable Images API #94

Closed
tyankatsu0105 opened this issue Jan 3, 2019 · 1 comment

Comments

Projects
None yet
3 participants
@tyankatsu0105
Copy link
Member

commented Jan 3, 2019

Summary

I want to get Image src.

Code

eyecatch type is Media

 query Posts {
  allContentfulPosts (perPage: 12) {
    totalCount
    edges {
      node {
        title
        slug
        eyecatch
      }
    }
  }
}

Current return value

"data": {
    "allContentfulPosts": {
      "totalCount": 1,
      "edges": [
        {
          "node": {
            "title": "Title",
            "slug": "1",
            "eyecatch": [
              "4bRUr9soZOiy6QwukMsqeg"
            ]
          }
        }
      ]
    }
  }

Expected Value

"data": {
    "allContentfulPosts": {
      "totalCount": 1,
      "edges": [
        {
          "node": {
            "title": "Title",
            "slug": "1",
            "eyecatch": {
              "title": "Playsam Streamliner",
              "file": {
                "fileName": "quwowooybuqbl6ntboz3.jpg",
                "contentType": "image/jpg",
                "details": {
                  "image": {
                    "width": 600,
                    "height": 446
                  },
                  "size": 27187
                },
                "url": "//images.ctfassets.net/yadj1kx9rmg0/wtrHxeu3zEoEce2MokCSi/cf6f68efdcf625fdc060607df0f3baef/quwowooybuqbl6ntboz3.jpg"
              }
            }
          }
        }
      ]
    }
  }

Basic example

https://www.contentful.com/developers/docs/references/images-api/

Motivation

It will be able to get image src url

@crsten

This comment has been minimized.

Copy link
Contributor

commented Jan 7, 2019

will be fixed in #102

@hjvedvik hjvedvik closed this in 0e541eb Jan 7, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.