{"id":14976122,"url":"https://github.com/prisma-archive/graphql-transform-schema","last_synced_at":"2026-03-17T09:33:07.763Z","repository":{"id":57136117,"uuid":"102269336","full_name":"prisma-archive/graphql-transform-schema","owner":"prisma-archive","description":"Transform, filter \u0026 alias resolvers of a GraphQL schema","archived":false,"fork":false,"pushed_at":"2018-11-24T12:49:07.000Z","size":73,"stargazers_count":84,"open_issues_count":12,"forks_count":9,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-10-29T12:05:18.913Z","etag":null,"topics":["apollo","graphql","graphql-schema","graphql-server"],"latest_commit_sha":null,"homepage":"https://example-rakllksfme.now.sh/graphiql","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/prisma-archive.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-09-03T14:13:35.000Z","updated_at":"2022-11-11T12:33:01.000Z","dependencies_parsed_at":"2022-08-31T22:20:15.405Z","dependency_job_id":null,"html_url":"https://github.com/prisma-archive/graphql-transform-schema","commit_stats":null,"previous_names":["graphcool/graphql-schema-transform"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/prisma-archive/graphql-transform-schema","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prisma-archive%2Fgraphql-transform-schema","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prisma-archive%2Fgraphql-transform-schema/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prisma-archive%2Fgraphql-transform-schema/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prisma-archive%2Fgraphql-transform-schema/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prisma-archive","download_url":"https://codeload.github.com/prisma-archive/graphql-transform-schema/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prisma-archive%2Fgraphql-transform-schema/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30620723,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-17T08:10:05.930Z","status":"ssl_error","status_checked_at":"2026-03-17T08:10:04.972Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apollo","graphql","graphql-schema","graphql-server"],"created_at":"2024-09-24T13:53:21.106Z","updated_at":"2026-03-17T09:33:07.746Z","avatar_url":"https://github.com/prisma-archive.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003e `graphql-transform-schema` has been deprecated in favor of [schema transforms as part of `graphql-tools`](https://www.apollographql.com/docs/graphql-tools/schema-transforms)\n\n# graphql-transform-schema [![npm version](https://badge.fury.io/js/graphql-transform-schema.svg)](https://badge.fury.io/js/graphql-transform-schema) [![Greenkeeper badge](https://badges.greenkeeper.io/graphcool/graphql-transform-schema.svg)](https://greenkeeper.io/)\n\nTransform, filter \u0026 alias resolvers of a GraphQL schema\n\n## Install\n\n```sh\nyarn add graphql-transform-schema\n```\n\n## Usage\n\nBy default `transformSchema` passes through all queries/mutations. ([Open Demo](https://example-rakllksfme.now.sh/graphiql))\n\n```ts\nimport { transformSchema } from 'graphql-transform-schema'\n\n// needed for remote schemas\nimport { createApolloFetch } from 'apollo-fetch'\nimport { makeRemoteExecutableSchema } from 'graphql-tools'\n\nconst schema = await makeRemoteExecutableSchema(createApolloFetch({\n  uri: 'https://api.graph.cool/simple/v1/swapi',\n}))\n\n// hide every query/mutation except the `Starship` and `allStarships` query\nconst transformedSchema = transformSchema(schema, {\n  '*': false,\n  Starship: true,\n  allStarships: true,\n})\n\nconst transformedSchema = transformSchema(schema, {\n  Query: {\n    '*': false,\n    Starship: true,\n    allStarships: true,\n  },\n  Mutation: {\n  \n  },\n  Starship: {\n    '*': false,\n    id: true,\n  },\n})\n```\n\n### API\n\n```ts\ninterface Rules {\n  [fieldName: string]: boolean | Function\n}\n\nfunction transformSchema(schema: GraphQLSchema, rules: Rules): GraphQLSchema\n```\n\n### Examples\n\n#### Remove all `createX` and `deleteX` mutations\n\n```ts\nconst transformedSchema = transformSchema(schema, {\n  Mutation: {\n    'create*': false,\n    'delete*': false\n  }\n})\n```\n\n#### Overwrite resolved data\n\n```ts\nconst typeDefs = `\n  type Query {\n    hello: String!\n  }\n\n  type Mutation {\n    alexaHello(name: String!): String!\n  }\n`\nconst resolvers = {\n  Query: {\n    hello: () =\u003e 'Hello world',\n  },\n  Mutation: {\n    alexaHello: (_, { name }) =\u003e `Alexa: Hello world, ${name}`,\n  },\n}\nconst schema = makeExecutableSchema({ typeDefs, resolvers })\n\nconst transformedSchema = transformSchema(schema, {\n  alexaHello: ({ args, resolve }) =\u003e resolve(args).replace('Bob', 'Alice'),\n})\n```\n\n#### Overwrite arguments\n\n```ts\nconst typeDefs = `\n  type Query {\n    hello: String!\n  }\n\n  type Mutation {\n    alexaHello(name: String!): String!\n  }\n`\nconst resolvers = {\n  Query: {\n    hello: () =\u003e 'Hello world',\n  },\n  Mutation: {\n    alexaHello: (_, { name }) =\u003e `Alexa: Hello world, ${name}`,\n  },\n}\nconst schema = makeExecutableSchema({ typeDefs, resolvers })\n\nconst transformedSchema = transformSchema(schema, {\n  alexaHello: ({ args, resolve }) =\u003e resolve({ name: 'John' }),\n})\n```\n\n## Next steps\n\n- [ ] Alias/rename types and fields\n- [ ] Transform field arguments\n- [ ] Compose new queries/mutations out of existing queries/mutations\n\n## Help \u0026 Community [![Slack Status](https://slack.graph.cool/badge.svg)](https://slack.graph.cool)\n\nJoin our [Slack community](http://slack.graph.cool/) if you run into issues or have questions. We love talking to you!\n\n![](http://i.imgur.com/5RHR6Ku.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprisma-archive%2Fgraphql-transform-schema","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprisma-archive%2Fgraphql-transform-schema","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprisma-archive%2Fgraphql-transform-schema/lists"}