This repository was archived by the owner on Dec 25, 2022. It is now read-only.
This repository was archived by the owner on Dec 25, 2022. It is now read-only.
Schema hierarchy / image not being downloaded #32
Open
Description
I've encountered some strange behaviour — I'm building my schemas and it appears that I have to choose between either my images downloading, or to have my api being brought in correctly. The two options I am presented with:
- Have my data being brought in with the correct hierarchy (in my case: conferences->events->image), but the images don't get downloaded.
- Have my data being brought in with a flat hierarchy (conferences, events->image) and with the images downloading.
to have the correct hierarchy I need to use this config:
{
resolve: "gatsby-source-custom-api",
options: {
url: {
production: "http://sculpture-poetry-cms.test/conferences.json",
development: "http://sculpture-poetry-cms.test/conferences.json",
},
auth: {
username: "username",
password: "password",
},
rootKey: "spConferences",
schemas: {
spConferences: `
conference: [conference]
`,
conference: `
uid: String
title: String
description: String
location: String
byline: String
startDate: String
endDate: String
button: button
events: [event]
`,
event: `
uid: String
slug: String
url: String
title: String
type: String
description: String
image: image
eventLink: eventLink
speakers: [speaker]
date: String
startTime: String
endTime: String
`,
image: `
url: String
modified: String
`,
speaker: `
uid: String
name: String
url: String
slug: String
`,
button: `
customText: String
value: String
`,
eventLink: `
customText: String
value: String
`,
},
},
},
BUT if I change events: [event]
to events: [events]
and rename the event schema also to match, the images download — though I can then no longer access the event information through the conferences in GraphQL as they appear as null
. The images appear under allImages
?
Metadata
Metadata
Assignees
Labels
No labels