|
| 1 | +diff --git a/cjs/index.js b/cjs/index.js |
| 2 | +index ed643f4440f514b0d933fea2d41d3fa456f99bd4..bcea9c4a71463bd46d20837a62d8b6d490b66c88 100644 |
| 3 | +--- a/cjs/index.js |
| 4 | ++++ b/cjs/index.js |
| 5 | +@@ -4,13 +4,14 @@ exports.transformSchemaAST = exports.validate = exports.plugin = void 0; |
| 6 | + const path_1 = require("path"); |
| 7 | + const plugin_helpers_1 = require("@graphql-codegen/plugin-helpers"); |
| 8 | + const graphql_1 = require("graphql"); |
| 9 | +-const plugin = async (schema, _documents, { commentDescriptions = false, includeDirectives = false, includeIntrospectionTypes = false, sort = false, federation, }) => { |
| 10 | ++const plugin = async (schema, _documents, { commentDescriptions = false, includeDirectives = false, includeIntrospectionTypes = false, sort = false, federation, append = '' }) => { |
| 11 | + const transformedSchemaAndAst = transformSchemaAST(schema, { sort, federation, includeIntrospectionTypes }); |
| 12 | + return [ |
| 13 | + includeIntrospectionTypes ? (0, graphql_1.printIntrospectionSchema)(transformedSchemaAndAst.schema) : null, |
| 14 | + includeDirectives |
| 15 | + ? (0, graphql_1.print)(transformedSchemaAndAst.ast) |
| 16 | + : graphql_1.printSchema(transformedSchemaAndAst.schema, { commentDescriptions }), |
| 17 | ++ append, |
| 18 | + ] |
| 19 | + .filter(Boolean) |
| 20 | + .join('\n'); |
| 21 | +diff --git a/esm/index.js b/esm/index.js |
| 22 | +index f386116b7c1931f84b7364ac6fcf743ccecafc5a..2d7e12c89722607ac62d64cd8fbbb5f3b332b297 100644 |
| 23 | +--- a/esm/index.js |
| 24 | ++++ b/esm/index.js |
| 25 | +@@ -1,13 +1,14 @@ |
| 26 | + import { extname } from 'path'; |
| 27 | + import { getCachedDocumentNodeFromSchema, removeFederation, } from '@graphql-codegen/plugin-helpers'; |
| 28 | + import { buildASTSchema, extendSchema, parse, print, printIntrospectionSchema, printSchema, visit, } from 'graphql'; |
| 29 | +-export const plugin = async (schema, _documents, { commentDescriptions = false, includeDirectives = false, includeIntrospectionTypes = false, sort = false, federation, }) => { |
| 30 | ++export const plugin = async (schema, _documents, { commentDescriptions = false, includeDirectives = false, includeIntrospectionTypes = false, sort = false, federation, append = '' }) => { |
| 31 | + const transformedSchemaAndAst = transformSchemaAST(schema, { sort, federation, includeIntrospectionTypes }); |
| 32 | + return [ |
| 33 | + includeIntrospectionTypes ? printIntrospectionSchema(transformedSchemaAndAst.schema) : null, |
| 34 | + includeDirectives |
| 35 | + ? print(transformedSchemaAndAst.ast) |
| 36 | + : printSchema(transformedSchemaAndAst.schema, { commentDescriptions }), |
| 37 | ++ append, |
| 38 | + ] |
| 39 | + .filter(Boolean) |
| 40 | + .join('\n'); |
| 41 | +diff --git a/typings/index.d.cts b/typings/index.d.cts |
| 42 | +index f2df25dbcbc5c7c0d0764452e06511dff8a1e896..083980b957de8b94ca9f77b801fcee34ef4189af 100644 |
| 43 | +--- a/typings/index.d.cts |
| 44 | ++++ b/typings/index.d.cts |
| 45 | +@@ -27,6 +27,8 @@ export interface SchemaASTConfig { |
| 46 | + * ``` |
| 47 | + */ |
| 48 | + includeDirectives?: boolean; |
| 49 | ++ /** Text to be appended at the end of the generated output. */ |
| 50 | ++ append?: string; |
| 51 | + /** |
| 52 | + * @description Include introspection types to Schema output. |
| 53 | + * @default false |
| 54 | +diff --git a/typings/index.d.ts b/typings/index.d.ts |
| 55 | +index f2df25dbcbc5c7c0d0764452e06511dff8a1e896..083980b957de8b94ca9f77b801fcee34ef4189af 100644 |
| 56 | +--- a/typings/index.d.ts |
| 57 | ++++ b/typings/index.d.ts |
| 58 | +@@ -27,6 +27,8 @@ export interface SchemaASTConfig { |
| 59 | + * ``` |
| 60 | + */ |
| 61 | + includeDirectives?: boolean; |
| 62 | ++ /** Text to be appended at the end of the generated output. */ |
| 63 | ++ append?: string; |
| 64 | + /** |
| 65 | + * @description Include introspection types to Schema output. |
| 66 | + * @default false |
0 commit comments