-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Open
Labels
type: bugcode to address defects in shipped codecode to address defects in shipped code
Description
Hello
i created a simple image field at cms
when i deleted the image from cms admin
its sets to empty on my json file
{ image:"} and start to got this error message
Field "image" must not have a selection since type "String" has no subfields Please replace with a clear and descriptive title
from graphql queries at page
there is a way to tell the widget to remove the field from json file
i already have the custom type defined
gastby-node.js
at exports.createSchemaCustomization
like this
type MemberCompanyNode {
id: String
big_logo: String
name: String
}
type CompanyNode {
image: File @fileByRelativePath
paragraph1: String
paragraph2: String
link: String
memberCompany: MemberCompanyNode
}
type OSFMemberNode {
osfMember: CompanyNode
}
type MemberSpotLiteSectionJson implements Node {
companies: [OSFMemberNode]
}
and graphql query at page is
memberSpotliteSectionJson {
companies {
osfMember {
image {
publicURL
}
link
memberCompany {
big_logo
}
paragraph1
paragraph2
}
}
}
also i tried to create a custom resolver
at gastby node.js
exports.createResolvers
createResolvers({
MemberSpotliteSectionJsonCompaniesOsfMember: {
image: {
type: "File",
resolve: (source) => {
console.log(`MemberSpotliteSectionJsonCompaniesOsfMember`,source.image)
(source?.image?.publicURL ? source.image : {publicURL:null})
},
},
},
});
but i got warn `createResolvers` passed resolvers for field `MemberSpotliteSectionJsonCompaniesOsfMember.image` with type `File`. Such a field with type `String` already exists on the type. Use `createTypes` to override type
fields.
really i am stuck at this
there is no simple way to delete an image at CMS and keep it working ?
much thanks
Metadata
Metadata
Assignees
Labels
type: bugcode to address defects in shipped codecode to address defects in shipped code