UNPKG

gatsby-source-prismic

Version:

Gatsby source plugin for building websites using Prismic as a data source

1 lines 22.3 kB
{"version":3,"file":"createSchemaCustomization.cjs","sources":["../../../src/gatsby-node/createSchemaCustomization.ts"],"sourcesContent":["import {\n\tAlternateLanguage,\n\tLinkField,\n\tLinkResolverFunction,\n\tLinkType,\n\tRichTextField,\n\tTitleField,\n\tasHTML,\n\tasLink,\n\tasText,\n\tisFilled,\n} from \"@prismicio/client\";\nimport type {\n\tCreateSchemaCustomizationArgs,\n\tGatsbyGraphQLObjectType,\n\tGatsbyGraphQLUnionType,\n} from \"gatsby\";\n\nimport { buildImageObjectType } from \"../lib/buildImageObjectType\";\nimport { buildImgixURLParamsInputObjectType } from \"../lib/buildImgixURLParamsInputObjectType\";\nimport { customTypeModelToGraphQLType } from \"../lib/customTypeModelToGraphQLType\";\nimport { getModelsCacheKey } from \"../lib/getModelsCacheKey\";\nimport { pascalCase } from \"../lib/pascalCase\";\nimport { resolveModels } from \"../lib/resolveModels\";\nimport { sharedSliceModelToGraphQLType } from \"../lib/sharedSliceModelToGraphQLType\";\n\nimport type { PluginOptions } from \"../types\";\n\nimport { GatsbyImageDataPlaceholderKind } from \"../constants\";\n\nexport const createSchemaCustomization = async <\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tTLinkResolverFunction extends LinkResolverFunction<any> = LinkResolverFunction,\n>(\n\targs: CreateSchemaCustomizationArgs,\n\toptions: PluginOptions<TLinkResolverFunction>,\n): Promise<void> => {\n\tconst { customTypeModels, sharedSliceModels } = await resolveModels({\n\t\tpluginOptions: options,\n\t});\n\n\targs.cache.set(\n\t\tgetModelsCacheKey({ repositoryName: options.repositoryName }),\n\t\t{\n\t\t\tcustomTypeModels,\n\t\t\tsharedSliceModels,\n\t\t},\n\t);\n\n\tlet customTypeTypes: GatsbyGraphQLObjectType[] = [];\n\n\tfor (const customTypeModel of customTypeModels) {\n\t\tconst type = customTypeModelToGraphQLType({\n\t\t\tmodel: customTypeModel,\n\t\t\tsharedSliceModels,\n\t\t\tpluginOptions: options,\n\t\t\tgatsbyNodeArgs: args,\n\t\t});\n\n\t\tcustomTypeTypes = [...customTypeTypes, type];\n\t}\n\n\tlet sharedSliceTypes: GatsbyGraphQLUnionType[] = [];\n\n\tfor (const sharedSliceModel of sharedSliceModels) {\n\t\tconst type = sharedSliceModelToGraphQLType({\n\t\t\tmodel: sharedSliceModel,\n\t\t\tsharedSliceModels,\n\t\t\tpluginOptions: options,\n\t\t\tgatsbyNodeArgs: args,\n\t\t});\n\n\t\tsharedSliceTypes = [...sharedSliceTypes, type];\n\t}\n\n\tconst sharedTypes = [\n\t\targs.schema.buildUnionType({\n\t\t\tname: pascalCase(\"Prismic\", options.typePrefix, \"AllDocumentTypes\"),\n\t\t\ttypes: customTypeTypes.map((type) => type.config.name),\n\t\t}),\n\t\targs.schema.buildObjectType({\n\t\t\tname: pascalCase(\"Prismic\", options.typePrefix, \"AlternateLanguage\"),\n\t\t\tdescription:\n\t\t\t\t\"Metadata for alternate versions of a document in different languages.\",\n\t\t\tfields: {\n\t\t\t\tid: {\n\t\t\t\t\ttype: \"ID!\",\n\t\t\t\t},\n\t\t\t\tuid: {\n\t\t\t\t\ttype: \"String\",\n\t\t\t\t},\n\t\t\t\tlang: {\n\t\t\t\t\ttype: \"String!\",\n\t\t\t\t},\n\t\t\t\ttype: {\n\t\t\t\t\ttype: \"String!\",\n\t\t\t\t},\n\t\t\t\turl: {\n\t\t\t\t\ttype: \"String\",\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t\"The URL of the Prismic document determined using the configured Route Resolvers or Link Resolver. If Route Resolvers or a Link Resolver is not given, this field is `null`.\",\n\t\t\t\t\tresolve: async (\n\t\t\t\t\t\tsource: AlternateLanguage,\n\t\t\t\t\t\t_args,\n\t\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\t\t\tctx: any,\n\t\t\t\t\t) => {\n\t\t\t\t\t\tconst node = await ctx.nodeModel.getNodeById({\n\t\t\t\t\t\t\tid: args.createNodeId(source.id),\n\t\t\t\t\t\t\ttype: pascalCase(\"Prismic\", options.typePrefix, source.type),\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\treturn asLink(node, { linkResolver: options.linkResolver });\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tdocument: {\n\t\t\t\t\ttype: `${pascalCase(\n\t\t\t\t\t\t\"Prismic\",\n\t\t\t\t\t\toptions.typePrefix,\n\t\t\t\t\t\t\"AllDocumentTypes\",\n\t\t\t\t\t)}!`,\n\t\t\t\t\tresolve: (source: AlternateLanguage): string => {\n\t\t\t\t\t\treturn args.createNodeId(source.id);\n\t\t\t\t\t},\n\t\t\t\t\textensions: { link: {} },\n\t\t\t\t},\n\t\t\t\traw: {\n\t\t\t\t\ttype: \"JSON!\",\n\t\t\t\t\tresolve: (source: AlternateLanguage): AlternateLanguage => {\n\t\t\t\t\t\treturn source;\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t}),\n\t\targs.schema.buildObjectType({\n\t\t\tname: pascalCase(\"Prismic\", options.typePrefix, \"EmbedField\"),\n\t\t\tdescription: \"oEmbed content from an oEmbed-enabled URL.\",\n\t\t\tfields: {\n\t\t\t\t// At least one field must be defined to supress a graphql-compose warning.\n\t\t\t\tid: \"ID!\",\n\t\t\t},\n\t\t\tinterfaces: [\"Node\"],\n\t\t\textensions: { infer: true },\n\t\t}),\n\t\targs.schema.buildObjectType({\n\t\t\tname: \"PrismicGeoPointField\",\n\t\t\tdescription: \"Geolocation coordinates.\",\n\t\t\tfields: {\n\t\t\t\tlatitude: {\n\t\t\t\t\ttype: \"Float\",\n\t\t\t\t\tdescription: \"The latitude value of the GeoPoint field.\",\n\t\t\t\t},\n\t\t\t\tlongitude: {\n\t\t\t\t\ttype: \"Float\",\n\t\t\t\t\tdescription: \"The longitude value of the GeoPoint field.\",\n\t\t\t\t},\n\t\t\t},\n\t\t}),\n\t\targs.schema.buildScalarType({\n\t\t\tname: \"PrismicRichText\",\n\t\t\tdescription:\n\t\t\t\t\"Text content with rich formatting capabilities used in Prismic documents.\",\n\t\t}),\n\t\targs.schema.buildObjectType({\n\t\t\tname: pascalCase(\"Prismic\", options.typePrefix, \"RichTextField\"),\n\t\t\tdescription: \"Rich Text provided in various formats.\",\n\t\t\tfields: {\n\t\t\t\ttext: {\n\t\t\t\t\ttype: \"String\",\n\t\t\t\t\tdescription: \"The Rich Text value formatted as text.\",\n\t\t\t\t\tresolve: (source: RichTextField | TitleField): string | null => {\n\t\t\t\t\t\tif (isFilled.richText(source)) {\n\t\t\t\t\t\t\treturn asText(source);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\thtml: {\n\t\t\t\t\ttype: \"String\",\n\t\t\t\t\tdescription: \"The Rich Text value formatted as HTML.\",\n\t\t\t\t\tresolve: (source: RichTextField | TitleField): string | null => {\n\t\t\t\t\t\tif (isFilled.richText(source)) {\n\t\t\t\t\t\t\treturn asHTML(source, {\n\t\t\t\t\t\t\t\tlinkResolver: options.linkResolver,\n\t\t\t\t\t\t\t\tserializer: options.htmlSerializer,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\trichText: {\n\t\t\t\t\ttype: \"PrismicRichText!\",\n\t\t\t\t\tdescription: 'The Rich Text value in its \"raw\" form.',\n\t\t\t\t\tresolve: (\n\t\t\t\t\t\tsource: RichTextField | TitleField,\n\t\t\t\t\t): RichTextField | TitleField => source,\n\t\t\t\t},\n\t\t\t\t// TODO: Remove in next major version.\n\t\t\t\traw: {\n\t\t\t\t\ttype: \"PrismicRichText!\",\n\t\t\t\t\tdescription: 'The Rich Text value in its \"raw\" form.',\n\t\t\t\t\tdeprecationReason:\n\t\t\t\t\t\t\"This field has been renamed to `richText`. The `richText` field has the same value the `raw` field.\",\n\t\t\t\t\tresolve: (\n\t\t\t\t\t\tsource: RichTextField | TitleField,\n\t\t\t\t\t): RichTextField | TitleField => source,\n\t\t\t\t},\n\t\t\t},\n\t\t}),\n\t\targs.schema.buildEnumType({\n\t\t\tname: \"PrismicLinkType\",\n\t\t\tdescription: \"Types of a Prismic Link field value.\",\n\t\t\tvalues: {\n\t\t\t\tAny: {\n\t\t\t\t\tdescription: \"An unknown link type.\",\n\t\t\t\t},\n\t\t\t\tDocument: {\n\t\t\t\t\tdescription: \"A link to a document in the Prismic repository.\",\n\t\t\t\t},\n\t\t\t\tMedia: {\n\t\t\t\t\tdescription: \"A link to a file in the Prismic Media Library.\",\n\t\t\t\t},\n\t\t\t\tWeb: {\n\t\t\t\t\tdescription: \"A link to the web.\",\n\t\t\t\t},\n\t\t\t},\n\t\t}),\n\t\targs.schema.buildObjectType({\n\t\t\tname: pascalCase(\"Prismic\", options.typePrefix, \"LinkField\"),\n\t\t\tdescription:\n\t\t\t\t\"A link to the web, a document in the Prismic repository, or a file in the Prismic Media Library\",\n\t\t\tfields: {\n\t\t\t\tlink_type: {\n\t\t\t\t\ttype: \"PrismicLinkType\",\n\t\t\t\t\tdescription: \"The type of link for this field value.\",\n\t\t\t\t},\n\t\t\t\tisBroken: {\n\t\t\t\t\ttype: \"Boolean\",\n\t\t\t\t\tdescription: \"Determines if the linked document exists.\",\n\t\t\t\t},\n\t\t\t\turl: {\n\t\t\t\t\ttype: \"String\",\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t\"The URL of the linked website, Prismic document, or file. If the field value is a Prismic document, the URL is determined using the configured Route Resolvers or Link Resolver. If Route Resolvers or a Link Resolver is not given, this field is `null`.\",\n\t\t\t\t\tresolve: (source: LinkField): string | null => {\n\t\t\t\t\t\tif (isFilled.link(source)) {\n\t\t\t\t\t\t\treturn asLink(source, { linkResolver: options.linkResolver });\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\ttarget: {\n\t\t\t\t\ttype: \"String\",\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t'`_blank` if the field value is configured to \"Open in a new window,\" `null` otherwise.',\n\t\t\t\t},\n\t\t\t\tsize: {\n\t\t\t\t\ttype: \"Int\",\n\t\t\t\t\tdescription: \"The file size of the linked file.\",\n\t\t\t\t},\n\t\t\t\tid: {\n\t\t\t\t\ttype: \"ID\",\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t\"The ID of the selected Prismic document if the field links to a document.\",\n\t\t\t\t},\n\t\t\t\ttype: {\n\t\t\t\t\ttype: \"String\",\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t\"The type of the selected Prismic document if the field links to a document.\",\n\t\t\t\t},\n\t\t\t\ttags: {\n\t\t\t\t\ttype: \"[String!]\",\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t\"The list of tags for the selected Prismic document if the field links to a document.\",\n\t\t\t\t},\n\t\t\t\tlang: {\n\t\t\t\t\ttype: \"String\",\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t\"The language of the selected Prismic document if the field links to a document.\",\n\t\t\t\t},\n\t\t\t\tslug: {\n\t\t\t\t\ttype: \"String\",\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t\"The slug of the selected Prismic document if the field links to a document.\",\n\t\t\t\t},\n\t\t\t\tuid: {\n\t\t\t\t\ttype: \"String\",\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t\"The UID of the selected Prismic document if the field links to a document that contains a UID field.\",\n\t\t\t\t},\n\t\t\t\tdocument: {\n\t\t\t\t\ttype: pascalCase(\"Prismic\", options.typePrefix, \"AllDocumentTypes\"),\n\t\t\t\t\tdescription: \"The Prismic document if the field links to a document.\",\n\t\t\t\t\tresolve: (source: LinkField): string | null => {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tisFilled.link(source) &&\n\t\t\t\t\t\t\tsource.link_type === LinkType.Document &&\n\t\t\t\t\t\t\t!source.isBroken\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\treturn args.createNodeId(source.id);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\textensions: { link: {} },\n\t\t\t\t},\n\t\t\t\tlocalFile: {\n\t\t\t\t\ttype: \"File\",\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t\"The locally download file if the field links to a media file and the field is configured to download locally.\",\n\t\t\t\t\textensions: { link: {} },\n\t\t\t\t},\n\t\t\t\traw: {\n\t\t\t\t\ttype: \"JSON!\",\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t\"**Do not use this field unless you know what you are doing**. The unprocessed field value returned from the Prismic REST API.\",\n\t\t\t\t\tresolve: (source: object): object => {\n\t\t\t\t\t\treturn source;\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t}),\n\t\targs.schema.buildInterfaceType({\n\t\t\tname: \"PrismicSlice\",\n\t\t\tdescription:\n\t\t\t\t\"A collection of fields used in flexible content areas (called Slice Zones) of a Prismic document.\",\n\t\t\tfields: {\n\t\t\t\tid: {\n\t\t\t\t\ttype: \"ID!\",\n\t\t\t\t},\n\t\t\t\tslice_type: {\n\t\t\t\t\ttype: \"String!\",\n\t\t\t\t},\n\t\t\t\tslice_label: {\n\t\t\t\t\ttype: \"String\",\n\t\t\t\t},\n\t\t\t},\n\t\t}),\n\t\targs.schema.buildInterfaceType({\n\t\t\tname: \"PrismicSharedSlice\",\n\t\t\tdescription:\n\t\t\t\t\"A collection of fields used in flexible content areas (called Slice Zones) of a Prismic document.\",\n\t\t\tfields: {\n\t\t\t\tid: {\n\t\t\t\t\ttype: \"ID!\",\n\t\t\t\t},\n\t\t\t\tslice_type: {\n\t\t\t\t\ttype: \"String!\",\n\t\t\t\t},\n\t\t\t\tslice_label: {\n\t\t\t\t\ttype: \"String\",\n\t\t\t\t},\n\t\t\t\tvariation: {\n\t\t\t\t\ttype: \"String!\",\n\t\t\t\t},\n\t\t\t\tversion: {\n\t\t\t\t\ttype: \"String!\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tinterfaces: [\"PrismicSlice\"],\n\t\t}),\n\t\targs.schema.buildObjectType({\n\t\t\tname: \"PrismicImageFieldDimensions\",\n\t\t\tdescription: \"Width and height of an image.\",\n\t\t\tfields: {\n\t\t\t\twidth: {\n\t\t\t\t\ttype: \"Int!\",\n\t\t\t\t\tdescription: \"The image's width in pixels.\",\n\t\t\t\t},\n\t\t\t\theight: {\n\t\t\t\t\ttype: \"Int!\",\n\t\t\t\t\tdescription: \"The image's height in pixels.\",\n\t\t\t\t},\n\t\t\t},\n\t\t}),\n\t\targs.schema.buildInterfaceType({\n\t\t\tname: \"PrismicImageFieldBase\",\n\t\t\tdescription: \"An Image field.\",\n\t\t\tfields: {\n\t\t\t\talt: {\n\t\t\t\t\ttype: \"String\",\n\t\t\t\t\tdescription: \"An alternative text for the image.\",\n\t\t\t\t},\n\t\t\t\tcopyright: {\n\t\t\t\t\ttype: \"String\",\n\t\t\t\t\tdescription: \"Copyright information for the image.\",\n\t\t\t\t},\n\t\t\t\tdimensions: {\n\t\t\t\t\ttype: \"PrismicImageFieldDimensions\",\n\t\t\t\t\tdescription: \"The image's width and height.\",\n\t\t\t\t},\n\t\t\t\turl: {\n\t\t\t\t\ttype: \"String\",\n\t\t\t\t\tdescription: \"The image's URL.\",\n\t\t\t\t},\n\t\t\t\tgatsbyImageData: {\n\t\t\t\t\ttype: \"JSON\",\n\t\t\t\t\tdescription: \"`gatsby-plugin-image` image data.\",\n\t\t\t\t},\n\t\t\t\tlocalFile: {\n\t\t\t\t\ttype: \"File\",\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t\"The locally download image file if the field is configured to download locally.\",\n\t\t\t\t\textensions: { link: {} },\n\t\t\t\t},\n\t\t\t},\n\t\t}),\n\t\tbuildImageObjectType({\n\t\t\tschema: args.schema,\n\t\t\tcache: args.cache,\n\t\t\tpluginOptions: options,\n\t\t}),\n\t\targs.schema.buildEnumType({\n\t\t\tname: \"PrismicGatsbyImageDataPlaceholder\",\n\t\t\tdescription:\n\t\t\t\t\"The style of temporary image shown while the full image loads.\",\n\t\t\tvalues: {\n\t\t\t\tBLURRED: {\n\t\t\t\t\tvalue: GatsbyImageDataPlaceholderKind.Blurred,\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t\"This generates a very low-resolution version of the source image and displays it as a blurred background.\",\n\t\t\t\t},\n\t\t\t\tDOMINANT_COLOR: {\n\t\t\t\t\tvalue: GatsbyImageDataPlaceholderKind.DominantColor,\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t\"The default placeholder. This calculates the dominant color of the source image and uses it as a solid background color.\",\n\t\t\t\t},\n\t\t\t\tNONE: {\n\t\t\t\t\tvalue: GatsbyImageDataPlaceholderKind.None,\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t\"No placeholder. You can use the background color option to set a static background if you wish.\",\n\t\t\t\t},\n\t\t\t},\n\t\t}),\n\t\tbuildImgixURLParamsInputObjectType({\n\t\t\tschema: args.schema,\n\t\t}),\n\t];\n\n\tfor (const type of [\n\t\t...customTypeTypes,\n\t\t...sharedSliceTypes,\n\t\t...sharedTypes,\n\t]) {\n\t\t// Calling this function for each type individually, rather\n\t\t// than once with an array containing all types, is done for\n\t\t// easier testing. We can check if the action was called\n\t\t// without also handling the extra layer of an array.\n\t\targs.actions.createTypes(type);\n\t}\n\n\tconst customTypeModelIDs = customTypeModels.map(\n\t\t(customTypeModel) => customTypeModel.id,\n\t);\n\targs.cache.set(\n\t\t`${options.repositoryName}:customTypeModelIDs`,\n\t\tcustomTypeModelIDs,\n\t);\n};\n"],"names":["resolveModels","getModelsCacheKey","customTypeModelToGraphQLType","sharedSliceModelToGraphQLType","pascalCase","asLink","isFilled","asText","asHTML","LinkType","buildImageObjectType","GatsbyImageDataPlaceholderKind","buildImgixURLParamsInputObjectType"],"mappings":";;;;;;;;;;;AA8Ba,MAAA,4B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