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

refactor: flatten Contentful asset data structure to match GraphQL API schema #31115

Conversation

axe312ger
Copy link
Collaborator

@axe312ger axe312ger commented Apr 29, 2021

This simplifies the asset data structure to match Contentfuls GraphQL API schema.

https://www.contentful.com/developers/docs/references/graphql/#/reference/schema-generation/assets

old schema

type ContentfulAsset implements ContentfulInternalReference & Node @dontInfer {
  file: ContentfulAssetFile
  title: String
  description: String
  sys: ContentfulInternalSys
}

type ContentfulAssetFile {
  url: String
  details: ContentfulAssetFileDetails
  fileName: String
  contentType: String
}

type ContentfulAssetFileDetails {
  size: Int
  image: ContentfulAssetFileDetailsImage
}

type ContentfulAssetFileDetailsImage {
  width: Int
  height: Int
}

new schema

type ContentfulAsset implements ContentfulInternalReference & Node @dontInfer {
  sys: ContentfulInternalSys
  title: String
  description: String
  contentType: String
  fileName: String
  url: String
  size: Int
  width: Int
  height: Int
}

@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Apr 29, 2021
@axe312ger axe312ger added breaking change If implemented, this proposed work would break functionality for older versions of Gatsby and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Apr 29, 2021
@axe312ger axe312ger force-pushed the feat/contentful-schema-generation branch from 6a445eb to ddea54d Compare May 5, 2021 10:29
@axe312ger axe312ger force-pushed the refactor/contentful-flatten-assets branch from 609fe42 to 87cee13 Compare May 5, 2021 10:30
@axe312ger axe312ger merged commit c36c252 into feat/contentful-schema-generation May 5, 2021
@axe312ger axe312ger deleted the refactor/contentful-flatten-assets branch May 5, 2021 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change If implemented, this proposed work would break functionality for older versions of Gatsby
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant