Skip to content

Commit

Permalink
update schema and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
axe312ger committed Jun 10, 2021
1 parent dd12731 commit 8e9aa65
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 70 deletions.
142 changes: 76 additions & 66 deletions e2e-tests/contentful/schema.gql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### Type definitions saved at 2021-06-10T13:26:49.703Z ###
### Type definitions saved at 2021-06-10T16:02:04.333Z ###

type File implements Node @dontInfer {
sourceInstanceName: String!
Expand Down Expand Up @@ -125,7 +125,7 @@ type MarkdownWordCount {
words: Int
}

type MarkdownRemark implements Node @childOf(mimeTypes: ["text/markdown", "text/x-markdown"], types: ["ContentfulNodeTypeText"]) @derivedTypes @dontInfer {
type MarkdownRemark implements Node @childOf(mimeTypes: ["text/markdown", "text/x-markdown"], types: ["ContentfulText"]) @dontInfer {
frontmatter: MarkdownRemarkFrontmatter
excerpt: String
rawMarkdownBody: String
Expand All @@ -135,12 +135,12 @@ type MarkdownRemarkFrontmatter {
title: String
}

interface ContentfulInternalReference implements Node {
interface ContentfulReference implements Node {
id: ID!
sys: ContentfulInternalSys
sys: ContentfulSys
}

type ContentfulInternalSys {
type ContentfulSys {
type: String!
id: String!
spaceId: String!
Expand All @@ -152,151 +152,161 @@ type ContentfulInternalSys {
locale: String!
}

type ContentfulContentType implements Node @derivedTypes @dontInfer {
type ContentfulContentType implements Node @dontInfer {
name: String!
displayField: String!
description: String!
sys: ContentfulContentTypeSys
}

type ContentfulContentTypeSys {
type: String
id: String
locale: String
spaceId: String
environmentId: String
firstPublishedAt: Date @dateformat
publishedAt: Date @dateformat
publishedVersion: Int
}

interface ContentfulEntry implements Node {
id: ID!
sys: ContentfulInternalSys
sys: ContentfulSys
}

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

type ContentfulAssetFile {
url: String
details: ContentfulAssetFileDetails
fileName: String
contentType: String
type ContentfulRichTextAssets {
block: [ContentfulAsset]!
hyperlink: [ContentfulAsset]!
}

type ContentfulAssetFileDetails {
size: Int
image: ContentfulAssetFileDetailsImage
type ContentfulRichTextEntries {
inline: [ContentfulEntry]!
block: [ContentfulEntry]!
hyperlink: [ContentfulEntry]!
}

type ContentfulAssetFileDetailsImage {
width: Int
height: Int
type ContentfulRichTextLinks {
assets: ContentfulRichTextAssets
entries: ContentfulRichTextEntries
}

type ContentfulNodeTypeRichText @dontInfer {
raw: JSON
references: [ContentfulInternalReference]
type ContentfulRichText @dontInfer {
json: JSON
links: ContentfulRichTextLinks
}

type ContentfulNodeTypeLocation @dontInfer {
type ContentfulLocation @dontInfer {
lat: Float!
lon: Float!
}

type ContentfulNodeTypeText implements Node @dontInfer {
type ContentfulText implements Node @dontInfer {
raw: String!
}

type ContentfulNumber implements ContentfulInternalReference & ContentfulEntry & Node @dontInfer {
sys: ContentfulInternalSys
type ContentfulContentTypeNumber implements ContentfulReference & ContentfulEntry & Node @dontInfer {
sys: ContentfulSys
title: String
integer: Int
integerLocalized: Int
decimal: Float
decimalLocalized: Float
}

type ContentfulText implements ContentfulInternalReference & ContentfulEntry & Node @dontInfer {
sys: ContentfulInternalSys
type ContentfulContentTypeText implements ContentfulReference & ContentfulEntry & Node @dontInfer {
sys: ContentfulSys
title: String
short: String
shortLocalized: String
shortList: [String]
shortListLocalized: [String]
longPlain: ContentfulNodeTypeText @link(by: "id", from: "longPlain___NODE")
longMarkdown: ContentfulNodeTypeText @link(by: "id", from: "longMarkdown___NODE")
longLocalized: ContentfulNodeTypeText @link(by: "id", from: "longLocalized___NODE")
longPlain: ContentfulText @link(by: "id", from: "longPlain___NODE")
longMarkdown: ContentfulText @link(by: "id", from: "longMarkdown___NODE")
longLocalized: ContentfulText @link(by: "id", from: "longLocalized___NODE")
}

type ContentfulMediaReference implements ContentfulInternalReference & ContentfulEntry & Node @dontInfer {
sys: ContentfulInternalSys
type ContentfulContentTypeMediaReference implements ContentfulReference & ContentfulEntry & Node @dontInfer {
sys: ContentfulSys
title: String
one: ContentfulAsset @link(by: "id", from: "one___NODE")
oneLocalized: ContentfulAsset @link(by: "id", from: "oneLocalized___NODE")
many: [ContentfulAsset] @link(by: "id", from: "many___NODE")
manyLocalized: [ContentfulAsset] @link(by: "id", from: "manyLocalized___NODE")
}

type ContentfulBoolean implements ContentfulInternalReference & ContentfulEntry & Node @dontInfer {
sys: ContentfulInternalSys
type ContentfulContentTypeBoolean implements ContentfulReference & ContentfulEntry & Node @dontInfer {
sys: ContentfulSys
title: String
boolean: Boolean
booleanLocalized: Boolean
}

type ContentfulDate implements ContentfulInternalReference & ContentfulEntry & Node @dontInfer {
sys: ContentfulInternalSys
type ContentfulContentTypeDate implements ContentfulReference & ContentfulEntry & Node @dontInfer {
sys: ContentfulSys
title: String
date: Date @dateformat
dateTime: Date @dateformat
dateTimeTimezone: Date @dateformat
dateLocalized: Date @dateformat
}

type ContentfulLocation implements ContentfulInternalReference & ContentfulEntry & Node @dontInfer {
sys: ContentfulInternalSys
type ContentfulContentTypeLocation implements ContentfulReference & ContentfulEntry & Node @dontInfer {
sys: ContentfulSys
title: String
location: ContentfulNodeTypeLocation
locationLocalized: ContentfulNodeTypeLocation
location: ContentfulLocation
locationLocalized: ContentfulLocation
}

type ContentfulJson implements ContentfulInternalReference & ContentfulEntry & Node @dontInfer {
sys: ContentfulInternalSys
type ContentfulContentTypeJson implements ContentfulReference & ContentfulEntry & Node @dontInfer {
sys: ContentfulSys
title: String
json: JSON
jsonLocalized: JSON
}

type ContentfulRichText implements ContentfulInternalReference & ContentfulEntry & Node @dontInfer {
sys: ContentfulInternalSys
type ContentfulContentTypeRichText implements ContentfulReference & ContentfulEntry & Node @dontInfer {
sys: ContentfulSys
title: String
richText: ContentfulNodeTypeRichText
richTextLocalized: ContentfulNodeTypeRichText
richTextValidated: ContentfulNodeTypeRichText
richText: ContentfulRichText
richTextLocalized: ContentfulRichText
richTextValidated: ContentfulRichText
}

type ContentfulContentReference implements ContentfulInternalReference & ContentfulEntry & Node @dontInfer {
sys: ContentfulInternalSys
type ContentfulContentTypeContentReference implements ContentfulReference & ContentfulEntry & Node @dontInfer {
sys: ContentfulSys
title: String
one: ContentfulEntry @link(by: "id", from: "one___NODE")
oneLocalized: ContentfulEntry @link(by: "id", from: "oneLocalized___NODE")
many: [ContentfulEntry] @link(by: "id", from: "many___NODE")
manyLocalized: [ContentfulEntry] @link(by: "id", from: "manyLocalized___NODE")
}

type ContentfulValidatedContentReference implements ContentfulInternalReference & ContentfulEntry & Node @dontInfer {
sys: ContentfulInternalSys
type ContentfulContentTypeValidatedContentReference implements ContentfulReference & ContentfulEntry & Node @dontInfer {
sys: ContentfulSys
title: String
oneItemSingleType: ContentfulEntry @link(by: "id", from: "oneItemSingleType___NODE")
oneItemManyTypes: ContentfulEntry @link(by: "id", from: "oneItemManyTypes___NODE")
oneItemAllTypes: ContentfulEntry @link(by: "id", from: "oneItemAllTypes___NODE")
multipleItemsSingleType: [ContentfulEntry] @link(by: "id", from: "multipleItemsSingleType___NODE")
multipleItemsManyTypes: [ContentfulEntry] @link(by: "id", from: "multipleItemsManyTypes___NODE")
multipleItemsAllTypes: [ContentfulEntry] @link(by: "id", from: "multipleItemsAllTypes___NODE")
}

type ContentfulContentTypeContentType implements Node @dontInfer {
name: String
displayField: String
description: String
sys: ContentfulContentTypeContentTypeSys
}

type ContentfulContentTypeContentTypeSys {
type: String
id: String
locale: String
spaceId: String
environmentId: String
firstPublishedAt: Date @dateformat
publishedAt: Date @dateformat
publishedVersion: Int
}
4 changes: 2 additions & 2 deletions e2e-tests/contentful/src/pages/date.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ export const pageQuery = graphql`
date
formatted: date(formatString: "D.M.YYYY")
}
dateEnglish: contentfulDate(
dateEnglish: contentfulContentTypeDate(
sys: { id: { eq: "1ERWZvDiYELryAZEP1dmKG" }, locale: { eq: "en-US" } }
) {
title
date: dateLocalized
formatted: dateLocalized(formatString: "D.M.YYYY - HH:mm:ss")
}
dateGerman: contentfulDate(
dateGerman: contentfulContentTypeDate(
sys: { id: { eq: "1ERWZvDiYELryAZEP1dmKG" }, locale: { eq: "de-DE" } }
) {
title
Expand Down
4 changes: 2 additions & 2 deletions e2e-tests/contentful/src/pages/json.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ export const pageQuery = graphql`
) {
json
}
english: contentfulJson(
english: contentfulContentTypeJson(
sys: { id: { eq: "7DvTBEPg5P6TRC7dI9zXuO" }, locale: { eq: "en-US" } }
) {
title
jsonLocalized
}
german: contentfulJson(
german: contentfulContentTypeJson(
sys: { id: { eq: "7DvTBEPg5P6TRC7dI9zXuO" }, locale: { eq: "de-DE" } }
) {
title
Expand Down

0 comments on commit 8e9aa65

Please sign in to comment.