You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// gatsby-node.jsexports.createResolvers=({ createResolvers })=>{createResolvers({Post: {imageUrl: {type: 'String!',resolve(source){constgetImageUrl=(text)=>{// The process of extracting the image URL from text}returngetImageUrl(source.text)},},},})}
I can retrieve the value of the field using the following query:
exportconstquery=graphql` { allPost { nodes { text # Text containing the image URL imageUrl # https://... } } }`
I have configured the field, but when I execute the query, an error occurs.
Error when resolving URL value for node type Post. This probably means that the rawURLKey function in gatsby-config.js is incorrectly set. Please read this project's README for detailed instructions on how to set this correctly.
Is it possible to use customized GraphQL fields?
The text was updated successfully, but these errors were encountered:
Before you submit:
Question
I have added a field for image URL using Gatsby createResolvers API.
I can retrieve the value of the field using the following query:
I have configured the field, but when I execute the query, an error occurs.
Error:
Is it possible to use customized GraphQL fields?
The text was updated successfully, but these errors were encountered: