Skip to content

Commit

Permalink
Merge pull request #96 from flotiq/bugfix/24449-cant-use-any-type
Browse files Browse the repository at this point in the history
fix graphQL for Any Type in relations
  • Loading branch information
WHLukasz authored Mar 19, 2024
2 parents fad7e0a + 62f0d77 commit 96bc319
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,8 @@ const createAditionalDef = (

const createTypeDefs = (contentTypesDefinitions, schema, includeTypes) => {
let typeDefs = [];
const names = contentTypesDefinitions.map(ctd => capitalize(ctd.name));
typeDefs.push(`union AllTypes = ${names.join(' | ')}`);
contentTypesDefinitions.forEach(ctd => {
let tmpDef = {
name: capitalize(ctd.name),
Expand Down Expand Up @@ -344,6 +346,7 @@ const getType = (propertyConfig, required, property, ctdName, includeTypes) => {
case 'datasource':
if (
includeTypes
&& propertyConfig.validation.relationContenttype !== ''
&& includeTypes.indexOf(propertyConfig.validation.relationContenttype) === -1
&& propertyConfig.validation.relationContenttype !== CTD_MEDIA
) {
Expand Down

0 comments on commit 96bc319

Please sign in to comment.