Have a decoupled Drupal 9 with Gatsby and a GraphQL. On Drupal's side there is a node called school there is a field (field_components) which is an Entity Reference Field which can have unlimited number of references to paragraphs. There are over 50 paragraph types on the site but that specific field only accept four (4) types. And I am trying to define their types in GraphQL.
exports.createSchemaCustomization = ({ actions }) => {
const { createTypes } = actions;
const typeDefs = `
type node__school implements Node {
field_location: String
field_type_r_a: Boolean
relationships: node__schoolRelationships
}
type node__schoolRelationships {
field_components: // this is where i need to define the 4 types
}
`
createTypes(typeDefs);
};
As you can see by the example above I've written out 90% of the necessary schema but I have no idea how to define the for paragraph types. I'm guessing that each individual paragraph would be called paragraph__machine_name (e.g. paragraph__carousel) but since there are four (4) of them I don't know how to chain them (define them all)
Any ideas?