API - identical elements, different responses (title nested in array)

Good day!

I have identical "title" elements set up in different custom types:


Those are queried using GraphQL and Gatsby (gatsby-source-prismic).

The funny thing is, that those identical elements and queries lead to different results. The response has the title's text in once case (External Article, TestType) nested in an array and in another not (Blog Post):


I double checked the schemas and looked for any differences in the types.
This could of course also be an issue of the source plugin and I have checked the repo for similar issues without any results.

What am I missing?

Hey there! :slight_smile:

Thanks for posting this question, and welcome to the Prismic community.

This is definitely strange behavior. I'm curious if this could be an issue with your local custom type JSON files. Is there a chance you changed your custom types in Prismic without updating the JSON locally? You could start by copy-pasting the JSON from your custom types in Prismic to the files in ~/src/schemas/.

Let me know if that helps at all! If not, I'll try to look into other potential causes.

Sam

1 Like

Hey @samlittlefair!

Thank you for the answer.

I double checked the schemas and copy pasted them completely from the editor again, just to be sure.

Would you mind telling me what the expected default behavior is?
Nested in an array or not?

Here as confirmation the two type schemas side by side:

Hey @user92532,

This behavior seems to be coming from the plugin, which isn't developer or maintained by Prismic, so I'm not 100% sure on the expected behavior. However, I tried recreating this issue with a few custom types, and I never got the title nested in an array — so I think the expected behavior is an object.

So, it sounds like double-checking the schemas didn't solve the issue? Let me know if that's the case, and I'll keep investigating.

Sam

Hey Sam.

If it's the case that the default should be an object, it is curious, as I got an array again, when I created a new type for testing. I assumed that this would have to be the default, but couldn't see why an array would make sense in this case. This type contains nothing but a title.

Double-checking did indeed not resolve the issue.
I will create more test types this afternoon and see, whether arrays remain to be the default behavior in my case.

I will also create an issue in the plugin repo and point to this thread.
Should we move the discussion there?

1 Like

Yes, please let me know if you create an issue, and we can continue the discussion on GitHub. Hopefully we can figure this out in the plugin.

Good morning Sam!

I opened an issue here.

Thank you for your help so far!

Great! Thank you. I'll keep an eye on the issue, and let you know about any movement on our side of things.

@team-education
Unfortunately there hasn't been any reaction so far.

Is it possible, that those errors, that are triggered during the build could hint at something being off on my side?

Full:

`ERROR

Field extension arguments must be provided as an object. Received "SEARCHABLE" on PrismicImageFixedType.base64.

ERROR

Field extension arguments must be provided as an object. Received "SORTABLE" on PrismicImageFixedType.base64.

ERROR

Field extension arguments must be provided as an object. Received "true" on PrismicImageFixedType.base64.

ERROR

Field extension arguments must be provided as an object. Received "SEARCHABLE" on PrismicImageFixedType.src.

ERROR

Field extension arguments must be provided as an object. Received "SORTABLE" on PrismicImageFixedType.src.

ERROR

Field extension arguments must be provided as an object. Received "true" on PrismicImageFixedType.src.

ERROR

Field extension arguments must be provided as an object. Received "SEARCHABLE" on PrismicImageFixedType.srcSet.

ERROR

Field extension arguments must be provided as an object. Received "SORTABLE" on PrismicImageFixedType.srcSet.

ERROR

Field extension arguments must be provided as an object. Received "true" on PrismicImageFixedType.srcSet.

ERROR

Field extension arguments must be provided as an object. Received "SEARCHABLE" on PrismicImageFixedType.srcWebp.

ERROR

Field extension arguments must be provided as an object. Received "SORTABLE" on PrismicImageFixedType.srcWebp.

ERROR

Field extension arguments must be provided as an object. Received "true" on PrismicImageFixedType.srcWebp.

ERROR

Field extension arguments must be provided as an object. Received "SEARCHABLE" on PrismicImageFixedType.srcSetWebp.

ERROR

Field extension arguments must be provided as an object. Received "SORTABLE" on PrismicImageFixedType.srcSetWebp.

ERROR

Field extension arguments must be provided as an object. Received "true" on PrismicImageFixedType.srcSetWebp.

ERROR

Field extension arguments must be provided as an object. Received "SEARCHABLE" on PrismicImageFixedType.sizes.

ERROR

Field extension arguments must be provided as an object. Received "SORTABLE" on PrismicImageFixedType.sizes.

ERROR

Field extension arguments must be provided as an object. Received "true" on PrismicImageFixedType.sizes.

ERROR

Field extension arguments must be provided as an object. Received "SEARCHABLE" on PrismicImageFixedType.width.

ERROR

Field extension arguments must be provided as an object. Received "SORTABLE" on PrismicImageFixedType.width.

ERROR

Field extension arguments must be provided as an object. Received "true" on PrismicImageFixedType.width.

ERROR

Field extension arguments must be provided as an object. Received "SEARCHABLE" on PrismicImageFixedType.height.

ERROR

Field extension arguments must be provided as an object. Received "SORTABLE" on PrismicImageFixedType.height.

ERROR

Field extension arguments must be provided as an object. Received "true" on PrismicImageFixedType.height.

ERROR

Field extension arguments must be provided as an object. Received "SEARCHABLE" on PrismicImageFluidType.base64.

ERROR

Field extension arguments must be provided as an object. Received "SORTABLE" on PrismicImageFluidType.base64.

ERROR

Field extension arguments must be provided as an object. Received "true" on PrismicImageFluidType.base64.

ERROR

Field extension arguments must be provided as an object. Received "SEARCHABLE" on PrismicImageFluidType.src.

ERROR

Field extension arguments must be provided as an object. Received "SORTABLE" on PrismicImageFluidType.src.

ERROR

Field extension arguments must be provided as an object. Received "true" on PrismicImageFluidType.src.

ERROR

Field extension arguments must be provided as an object. Received "SEARCHABLE" on PrismicImageFluidType.srcSet.

ERROR

Field extension arguments must be provided as an object. Received "SORTABLE" on PrismicImageFluidType.srcSet.

ERROR

Field extension arguments must be provided as an object. Received "true" on PrismicImageFluidType.srcSet.

ERROR

Field extension arguments must be provided as an object. Received "SEARCHABLE" on PrismicImageFluidType.srcWebp.

ERROR

Field extension arguments must be provided as an object. Received "SORTABLE" on PrismicImageFluidType.srcWebp.

ERROR

Field extension arguments must be provided as an object. Received "true" on PrismicImageFluidType.srcWebp.

ERROR

Field extension arguments must be provided as an object. Received "SEARCHABLE" on PrismicImageFluidType.srcSetWebp.

ERROR

Field extension arguments must be provided as an object. Received "SORTABLE" on PrismicImageFluidType.srcSetWebp.

ERROR

Field extension arguments must be provided as an object. Received "true" on PrismicImageFluidType.srcSetWebp.

ERROR

Field extension arguments must be provided as an object. Received "SEARCHABLE" on PrismicImageFluidType.sizes.

ERROR

Field extension arguments must be provided as an object. Received "SORTABLE" on PrismicImageFluidType.sizes.

ERROR

Field extension arguments must be provided as an object. Received "true" on PrismicImageFluidType.sizes.

ERROR

Field extension arguments must be provided as an object. Received "SEARCHABLE" on PrismicImageFluidType.aspectRatio.

ERROR

Field extension arguments must be provided as an object. Received "SORTABLE" on PrismicImageFluidType.aspectRatio.

ERROR

Field extension arguments must be provided as an object. Received "true" on PrismicImageFluidType.aspectRatio.`

Hey there!

Good news!

The maintainer wrote me in Github and asked me to post my gatsby-config.js setup and this was directly where my mistake was.

I forgot to require the newly created schemas in the config altogether.
So simple, haha.

After testing with one of the newly added test types, I can confirm, that I now receive the expected response:


Thank you for your help with the issue, @samlittlefair !

I hope this thread will spare somebody else some confusion.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

@user92532 Awesome! I'm glad you got a solution. Thanks for posting the question and working through it with us here :slight_smile:

1 Like