{"_id":"@autotelic/graphql-schema-tools","_rev":"4-5d7a667f9d451dfae8192235eeaa04ce","name":"@autotelic/graphql-schema-tools","dist-tags":{"latest":"0.4.0"},"versions":{"0.1.0":{"name":"@autotelic/graphql-schema-tools","version":"0.1.0","description":"Tools for GraphQL schemas.","main":"index.js","scripts":{"lint":"standard","test":"tap --100 -j1 -R classic","validate":"npm run lint && npm run test"},"repository":{"type":"git","url":"git+https://github.com/autotelic/graphql-schema-tools.git"},"keywords":["GraphQL","Schema","Tools","Utils"],"author":{"name":"Holden Whitehead","email":"holden@autotelic.com"},"license":"MIT","bugs":{"url":"https://github.com/autotelic/graphql-schema-tools/issues"},"homepage":"https://github.com/autotelic/graphql-schema-tools#readme","devDependencies":{"graphql":"^15.5.0","standard":"^16.0.3","tap":"^14.11.0"},"peerDependencies":{"graphql":"^14.0.0 || ^15.0.0"},"gitHead":"7abc5f59a1db2549c68439aa2831f110dadacceb","_id":"@autotelic/graphql-schema-tools@0.1.0","_nodeVersion":"12.21.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-h7sClKM9yaKOZZ2rQUTyBI2Hp/HSK3rwjWZaH4zfdAx+311KVAnyxDBBQdCjRPhmWJMnK9p6Cq05jJkOZ+TgZQ==","shasum":"3de7c4f43cd8fe3061cd5ffcbec706e41401f6f1","tarball":"https://registry.npmjs.org/@autotelic/graphql-schema-tools/-/graphql-schema-tools-0.1.0.tgz","fileCount":6,"unpackedSize":11810,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgS6bnCRA9TVsSAnZWagAAzEAQAKNp6CI0NNvzc3hCGf0w\nGtFIRKwMOOo4IFzXGfF9dvzTw2zwvscpfnNL9alvaBQwZQj9Dg0vhrvWE7cP\nahrc38WzYQcJtdxkcG3wcPHCdKiPxKixyx99UHNR7xA1ZCB5bfv+ils54nnS\njOe5o3cPB+cTkMb7bSBjQIDRsuxlaAFMjP/HRL5KlQyFW518U9NAjK/aa1lt\neXnRIrrqm2VCgGfobwDUtfynfM+gzZZpfjxEtrrp1KoJ+fwrfLsQL4XHMkRi\nOqS9YLMWRI9vhbYtPwDgijOU+QxHF0QjWT93nG6x7dZqOwipivbKmVNPtg80\n1LI0/FwpHDmGLb53NYCmiaitrHIrfGP1DhptfuDmxf/J+9fRsaeDSYM+iMrc\nUm76hZIX0EvZf3K27IJBU4Jn7EHAyMLyafmaCsBw2n1xvOZsWef5DIsBtzB0\nXq3tVHfe/8OXvDiZt1q7iBOoEs2j3+edILUajmq30Jcd27VwqtQK8aKC4UdU\nNq7oRZ0HDfKlLcdnhJG6ZB/v2T1wLc/OL9npg92hN6IXsXPvIKxyF0IRcIsc\niUhqoA3/Ht9WuKUtBMPBxQGpXVFhtKODbWlgHofDH19qVbrZPn6rUcjAwXZi\nlKiTZeGcg7u2AMTKP75VeZY6DxNXlECjJfCsSIppVYHEU5agwIj2oHGYwRvW\n/fQT\r\n=3JkA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCe63F6uMt2vBoaalFD3BnyA+xqabUixpwAJVBIewVuqwIgO1g8LXSZIRyM9+SgNB2Tn7xQL4ERF+qZvL8gBG+i+2U="}]},"_npmUser":{"name":"autotelic","email":"info+npm@autotelic.com"},"directories":{},"maintainers":[{"name":"autotelic","email":"info+npm@autotelic.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-schema-tools_0.1.0_1615570662169_0.03801792164749651"},"_hasShrinkwrap":false},"0.2.0":{"name":"@autotelic/graphql-schema-tools","version":"0.2.0","description":"Tools for GraphQL schemas.","main":"index.js","scripts":{"lint":"standard","test":"tap --100 -j1 -R classic","validate":"npm run lint && npm run test"},"repository":{"type":"git","url":"git+https://github.com/autotelic/graphql-schema-tools.git"},"keywords":["GraphQL","Schema","Tools","Utils"],"author":{"name":"Holden Whitehead","email":"holden@autotelic.com"},"license":"MIT","bugs":{"url":"https://github.com/autotelic/graphql-schema-tools/issues"},"homepage":"https://github.com/autotelic/graphql-schema-tools#readme","devDependencies":{"graphql":"^15.5.0","standard":"^16.0.3","tap":"^14.11.0"},"peerDependencies":{"graphql":"^14.0.0 || ^15.0.0"},"gitHead":"6dfb14819d87f6fcb6fb405e2b3138f58afee8f3","_id":"@autotelic/graphql-schema-tools@0.2.0","_nodeVersion":"12.21.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-KVeocWxIW9WjAQzV4vIex2pz7EnM/YphGy/JSVTuRth33Jr79JWsWiZfyT6y+uB4ukXDF1xHMexxsdbLieY1cg==","shasum":"55f87f07f8fe8bd7cc9ca081f6c839f50ac3ee15","tarball":"https://registry.npmjs.org/@autotelic/graphql-schema-tools/-/graphql-schema-tools-0.2.0.tgz","fileCount":10,"unpackedSize":16338,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgUjw8CRA9TVsSAnZWagAA9K8P/2AWkkFG3LrraveiDhsI\n6TA7xj/RF5M1XBB00fGbi7z81sS7ZtZ/ETwXMOBKCg9CfM/C96qIDZBkMLl4\nmLHMahtSScGwE2KlzxdJg3QzizQMlwafp/5ApBSxLOoFWzBM1by6rOGUQ0GT\nZInKCbIDLbd22cbs+GilFtpyq6gaRZqtUmONXDDzmEQX3rmeVTi0iuPNk7Ii\nHXkkQsbJdIzgWRlp+JRWl41B2OSs4CxRb8+ZbU2CBd9DyqbmR8OrGuNJrHjy\nk956VUymvBBhuEXJRGuT9uaTJk6vrZfDCVpmgTUzgxZQPtTnGqx6OQb/GfjL\njjDMkMFEAWdL1xvYKynOXTmDKhgGsg7Yvf4+UmXU984HADT1yx4j+ThwfE6b\nrBvGA5N1+kN4SpBtxiTZ5cwpsXUK2qRIuaT5OeYwb5+IKp7kEeMLV9SzvbFh\nwj1YDoQ4wBQqJk7JD/vI9VkgEwREQNnUou2gmdA2VDVoUYSSP2HSXUfG8e+b\nVRHffalIj3NwmbbXB+qHtg0rM7vvgCa0U7uk/ld8vAGSFYiKYpIh+y5Vt2OJ\nOLGboTY1MipZFQvlqjeMyAfHLXWeZtX9+WUER31N2AFir4/DYY14a8m/Ciq+\nApUQnZ1Uy8+IDutpC+7q0UlbceKcKp7jsaoAIdzvL7z/TJP7/K5Vd/jFoGAJ\nPcqn\r\n=0CZe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIESI5soIK/28miqt1OtSsuRSqvTQh0oIyK9WOYG27wwPAiA5Uh1bqTBtvs8xH4XRXxOu0Dz5DB1f2GeFGKTlX9EmBA=="}]},"_npmUser":{"name":"autotelic","email":"info+npm@autotelic.com"},"directories":{},"maintainers":[{"name":"autotelic","email":"info+npm@autotelic.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-schema-tools_0.2.0_1616002108125_0.9120427987787845"},"_hasShrinkwrap":false},"0.3.0":{"name":"@autotelic/graphql-schema-tools","version":"0.3.0","description":"Tools for GraphQL schemas.","main":"index.js","engines":{"node":">= 12.0.0"},"scripts":{"lint":"standard","test":"tap --100 -j1 -R classic","validate":"npm run lint && npm run test"},"repository":{"type":"git","url":"git+https://github.com/autotelic/graphql-schema-tools.git"},"keywords":["GraphQL","Schema","Tools","Utils"],"author":{"name":"Holden Whitehead","email":"holden@autotelic.com"},"license":"MIT","bugs":{"url":"https://github.com/autotelic/graphql-schema-tools/issues"},"homepage":"https://github.com/autotelic/graphql-schema-tools#readme","devDependencies":{"@graphql-tools/stitch":"^7.5.3","graphql":"^15.5.0","standard":"^16.0.3","tap":"^15.0.9"},"peerDependencies":{"graphql":"^14.0.0 || ^15.0.0"},"gitHead":"f40e03a5613b4af7638b7a56ab4ce90acb78d882","_id":"@autotelic/graphql-schema-tools@0.3.0","_nodeVersion":"12.22.1","_npmVersion":"6.14.12","dist":{"integrity":"sha512-n4l+eGTt1narUL/gcXKF5hs2dvwxrtEbfeGbBQbIg7CoCpma60ybXWXCuhSUJolyh4vHJMRPuEkBPEH1ZiLHUw==","shasum":"fc774d36c949c8de47c8b9e77494269f52afe9c4","tarball":"https://registry.npmjs.org/@autotelic/graphql-schema-tools/-/graphql-schema-tools-0.3.0.tgz","fileCount":16,"unpackedSize":30547,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgtV4XCRA9TVsSAnZWagAAPoEP/1JixigbD/Hw2eySwfv/\ntGjSU7RP0kM49SzEMn0C1iY5Z1wzubvet8csxlcCcAKcSoTlNYKZPmOKJj6t\ns3sb/O3dD6wAXeJZTftOpZfa1q9AC1DxfYVCcCuWklzps6zffUg6vT/40PrS\n2evZUrMQHRbSf2WRoq38z/JOqIxqTbKT4MqLB1HDY6h8mu9XVPPDPTnC24fr\nuzKXqC6ok/obTft0fiConO8ViC4ScEdW1SL167NfiwdtLFfja/at3ZAPoAO8\n2d7N2oC1tSGgX+o25kYi7NGw8aeOzrZTdM9EJ3UzU3bf4HE1KOCxJDkEN8Iu\nq2ZRsOrlzDNZn1cPB8JcP3erSy8cUuqu+Yufg2/fM0q7sy4OoaYsfoUjQBk4\ngg0Blthe51Ld91VgsOoYnZ6eKnac+RbXAF9XcacT239uJC7Oaqg22LQwHIY7\nxXVSXmUjIDNeojMb5/x+TxRTZ9rr9In5ZnkTMya4XT3+c3qVaIrjy5iJoysw\n+EvWGH6w4zf8X2bWvspJ6ZjhzTnb3oydMZFFZMfFaKuHa1icvXt2uv0NGQt+\n//yVkLWpIkwS6JKpmY6jOK5cPBntA9IGFZvW0LaTsOZoW+2Qwef2T440aBus\nR18wmYKw+oYyXaRBwYqnaMeQh8iZW1P8VWUQmHJH5c18/0s6Gl3qqqBMcM7r\nDcgB\r\n=mQ0Y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD7xMXabldzUjORs/A/LlAI82gxghnWWz4EabMXi1eQfQIgQq3K41ZExADARmhEGEjH+hXUp7MT1n+e6F3dVYEBR9c="}]},"_npmUser":{"name":"autotelic","email":"info+npm@autotelic.com"},"directories":{},"maintainers":[{"name":"autotelic","email":"info+npm@autotelic.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-schema-tools_0.3.0_1622498839193_0.6993382234815393"},"_hasShrinkwrap":false},"0.4.0":{"name":"@autotelic/graphql-schema-tools","version":"0.4.0","description":"Tools for GraphQL schemas.","main":"index.js","engines":{"node":">= 12.0.0"},"scripts":{"lint":"standard","test":"tap --100 -j1 -R classic","validate":"npm run lint && npm run test"},"repository":{"type":"git","url":"git+https://github.com/autotelic/graphql-schema-tools.git"},"keywords":["GraphQL","Schema","Tools","Utils"],"author":{"name":"Holden Whitehead","email":"holden@autotelic.com"},"license":"MIT","bugs":{"url":"https://github.com/autotelic/graphql-schema-tools/issues"},"homepage":"https://github.com/autotelic/graphql-schema-tools#readme","devDependencies":{"@graphql-tools/stitch":"^8.6.9","graphql":"^16.4.0","standard":"^16.0.3","tap":"^16.0.0"},"peerDependencies":{"graphql":"^14.0.0 || ^15.0.0 || ^16.0.0"},"gitHead":"c0dcb2761014cfdc3a0dac914fd803a695418e6c","_id":"@autotelic/graphql-schema-tools@0.4.0","_nodeVersion":"12.22.12","_npmVersion":"6.14.16","dist":{"integrity":"sha512-eUZ+Y56/L2TTkh8gyx2whB6LRtWIqYr68f6bcSMaqT9Ob0nkPtDeQsNZnTSO40iS6I0xBFO0UiW9PqMPaEp4bg==","shasum":"1aa041dc5ca97033a605a659ace0b1d0b9d2a0e9","tarball":"https://registry.npmjs.org/@autotelic/graphql-schema-tools/-/graphql-schema-tools-0.4.0.tgz","fileCount":16,"unpackedSize":30553,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCgJKrvkJDGjNBXXJqrXAJNzhK2WL/dtQcFiiK/RhpFDwIgFH/PIcQhVDoQSnVL4mX3hP3Dli2NDnEvBdJY2wUjgLA="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJicviPACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr5fg//VwS1UoZ3imjGg+Go+i2kWnAmFcgm63TTScK55paianPXxGAe\r\nKdfG9JdE37rUz8pbKJkdTWcenNBbzCZGA2+gznhXAtCp6sKXJqDx0MtA9bg3\r\noav018dB5AssgRqS3rcEbRLuJjf8TblAleSMY7eKZmIllSYHm6F1ZkAZt1jK\r\nRcVC2k2pUfHrJ4GEVLyClGNf8cdZv74wDQtOMz+L7nyf0KHMWYQ+QzQG/eXo\r\n1UH8MsfnwbwUEUW3vC7Z272RBmYd+GQdmIoNGZIBB32611SLSgavCGnGeY2S\r\n34EwseOaWNm41oNkPEKK/xzSlt5YnINtruJlWtg7WFjfT61bNuVFqM4U5HqT\r\naeLQU3l8mbNMc5Yx1T2xgyB1ZMEDm+M+8GC6OdRaRRr0Nn6/pn3Xulz2o3w2\r\nEcej8I7UzU/VcXdDdewvSg87yIxgKm2AdMRoLKtB2BG/e9phuwLE6U/+zUNK\r\n/1jZIbmAnqtwXUCp7+O1W4E53/1b6aa0yswIeNKLLHkzDJ5LMlftq64JcCP8\r\nhcpHVpG17/KdU3Q6t8+cydaDazlaBSYmEV/cvmu1UAS/oECkm1AmU5FW99NG\r\n4vMrUe9p/ft9+Vd8fbEJJ6XBWecMQ8Jf/GtY5VtjJP4qjRN6DRi2cXsN6U/X\r\nZW/GVw35CHXINZUDKsrQZJ8VovIh0kJTxQI=\r\n=npKu\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"autotelic","email":"info+npm@autotelic.com"},"directories":{},"maintainers":[{"name":"autotelic","email":"info+npm@autotelic.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-schema-tools_0.4.0_1651701902940_0.08104662260177253"},"_hasShrinkwrap":false}},"time":{"created":"2021-03-12T17:37:42.137Z","0.1.0":"2021-03-12T17:37:42.333Z","modified":"2022-05-04T22:05:03.365Z","0.2.0":"2021-03-17T17:28:28.299Z","0.3.0":"2021-05-31T22:07:19.316Z","0.4.0":"2022-05-04T22:05:03.250Z"},"maintainers":[{"name":"autotelic","email":"info+npm@autotelic.com"}],"description":"Tools for GraphQL schemas.","homepage":"https://github.com/autotelic/graphql-schema-tools#readme","keywords":["GraphQL","Schema","Tools","Utils"],"repository":{"type":"git","url":"git+https://github.com/autotelic/graphql-schema-tools.git"},"author":{"name":"Holden Whitehead","email":"holden@autotelic.com"},"bugs":{"url":"https://github.com/autotelic/graphql-schema-tools/issues"},"license":"MIT","readme":"# GraphQL Schema Tools\n\n### Usage\n\n```sh\nnpm i @autotelic/graphql-schema-tools\n```\n\n### API\n##### Contents\n\n  - [`normalizeGQLSource`](#normalizegqlsource-source-string-options-object--object)\n  - [`minifyGQLSource`](#minifygqlsource-source-string--string)\n  - [`enhanceGQLSyntaxError`](#enhancegqlsyntaxerror-error-graphqlerror--graphqlerror)\n  - [`printSDL`](#printsdl-schema-graphqlschema-options-object--documentnode)\n  - [`astFromSchema`](#astfromschema-schema-graphqlschema-options-object--documentnode)\n\n#### `normalizeGQLSource`: `(source: string, options?: object) => object`\n\nWhen passed a string GQL source, `normalizeGQLSource` groups top-level declarations by kind and then alphabetizes them along with their fields, directives, arguments, values, types, interfaces, and locations - all by name.\n\nAccepts an optional `options` object containing the following properties:\n  - **`minify`: `boolean`** - If `true`, the returned source will have all redundant whitespace stripped out. Defaults to `false`.\n\nReturns an object with the following properties:\n  - **`source`: `string`**- The normalized GQL source.\n  - **`error`: `GraphQLError | undefined`** - If an error occurs, it will be added here.\n\n##### Example\n\n```js\nconst { normalizeGQLSource } = require('@autotelic/graphql-schema-tools')\n\nconst schema = `\n  type Query {\n    products(priceUnder: Float priceOver: Float category: String): [Products]! @paginate @cacheControl(maxAge: 2000 scope: PUBLIC)\n    customer(id: ID): Customer\n  }\n\n type Product {\n    name: String!\n    price: Float!\n    category: String!\n    id: ID!\n  }\n\n  type Customer @cacheControl(scope: PRIVATE maxAge: 1000) {\n    name: String!\n    address: String!\n    id: ID!\n  }\n\n  directive @paginate on FIELD_DEFINITION\n  directive @cacheControl(scope: CacheScope maxAge: Int) on OBJECT | FIELD_DEFINITION\n\n  enum CacheScope {\n    PUBLIC\n    PRIVATE\n  }\n`\n\nconst { source, error } = normalizeGQLSource(schema)\n\n```\n\nGiven the above `schema`, the returned `source` would look like:\n\n```gql\ndirective @cacheControl(maxAge: Int, scope: CacheScope) on FIELD_DEFINITION | OBJECT\n\ndirective @paginate on FIELD_DEFINITION\n\nenum CacheScope {\n  PRIVATE\n  PUBLIC\n}\n\ntype Customer @cacheControl(maxAge: 1000, scope: PRIVATE) {\n  address: String!\n  id: ID!\n  name: String!\n}\n\ntype Product {\n  category: String!\n  id: ID!\n  name: String!\n  price: Float!\n}\n\ntype Query {\n  customer(id: ID): Customer\n  products(category: String, priceOver: Float, priceUnder: Float): [Products]! @cacheControl(maxAge: 2000, scope: PUBLIC) @paginate\n}\n\n```\n\n#### `minifyGQLSource`: `(source: string) => string`\n\nReturns the provided `source` with all redundant whitespace stripped out.\n\n##### Example\n\n```js\nconst { minifyGQLSource } = require('@autotelic/graphql-schema-tools')\n\nconst schema = `\n  type Query {\n    foo: String\n    bar(foo: String, id: ID): String\n  }\n`\n\nconst minified = minifyGQLSource(schema)\n// The resulting minified schema will look like:\n// 'type Query{foo:String bar(foo:String,id:ID):String}'\n```\n\n#### `enhanceGQLSyntaxError`: `(error: GraphQLError) => GraphQLError`\n\nIf the provided `error` contains `source` and `locations` properties, `enhanceGQLSyntaxError` will return the provided `GraphQLError` with a modified `message` - containing a condensed snippet showing where in the source the error occurred.\n\n##### Example\n\n```js\nconst { enhanceGQLSyntaxError } = require('@autotelic/graphql-schema-tools')\n\nconst schemaWithError = `\n  type Foo {\n    id: ID!\n    bar: String\n  }\n\n\n\n}\n    `\n\ntry {\n  parse(schemaWithError)\n} catch (error) {\n  const enhancedError = enhanceGQLSyntaxError(error)\n  console.log(enhancedError.message)\n  // Logs: 'Syntax Error: Unexpected \"}\". Found near: `bar: String } }`.'\n}\n```\n\n#### `printSDL`: `(schema: GraphQLSchema, options: object) => DocumentNode`\n\nReturns an SDL string representation of the provided `schema`.\n\nAccepts an optional `options` object containing the following properties:\n\n - **`minify`: `boolean`** - If `true`, the returned source will have all redundant whitespace stripped out. Defaults to `false`.\n - **`filterTypes`: `string[] | (GraphQLNamedType) => boolean`** - Accepts an array of type names that will be filtered out of the returned AST. Alternatively a custom filter function can be passed in.\n - **`filterDirectives`: `string[] | (GraphQLDirective) => boolean`** - Accepts an array of directive names that will be filtered out of the returned AST. Alternatively a custom filter function can be passed in.\n\n##### Example\n\n```js\nconst { printSDL } = require('@autotelic/graphql-schema-tools')\nconst federatedSchema = require('./schema')\n\nconst SDL = printSDL(federatedSchema, {\n  minify: true,\n  filterDirectives: ['key', 'external', 'requires', 'provides', 'extends'],\n  filterFields: {\n    Query: ['_service', '_entities']\n  },\n  filterTypes: ['_Any', '_FieldSet', '_Service']\n})\n```\n\n#### `astFromSchema`: `(schema: GraphQLSchema, options: object) => DocumentNode`\n\nReturns an AST representation of the provided `schema`.\n\nAccepts an optional `options` object containing the following properties:\n\n - **`filterTypes`: `string[] | (TypeDefinitionNode) => boolean`** - Accepts an array of type names that will be filtered out of the returned AST. Alternatively a custom filter function can be passed in.\n - **`filterDirectives`: `string[] | (DirectiveDefinitionNode) => boolean`** - Accepts an array of directive names that will be filtered out of the returned AST. Alternatively a custom filter function can be passed in.\n - **`filterFields`: `{ [string]: string[] } | (FieldDefinitionNode, TypeDefinitionNode) => boolean`** - Accepts an object with keys of type names and values of arrays of field names to filter out of the returned AST. Alternatively a custom filter function can be passed in - the function will receive the current field (`FieldDefinitionNode`) and the parent type (`TypeDefinitionNode`).\n\n##### Example\n\n```js\nconst { astFromSchema } = require('@autotelic/graphql-schema-tools')\nconst federatedSchema = require('./schema')\n\nconst document = astFromSchema(federatedSchema, {\n  filterDirectives: ['key', 'external', 'requires', 'provides', 'extends'],\n  filterFields: {\n    Query: ['_service', '_entities']\n  },\n  filterTypes: ['_Any', '_FieldSet', '_Service']\n})\n```\n","readmeFilename":"README.md"}