{"id":21922689,"url":"https://github.com/mvr-studio/graphql-codegen-plugin-schema-to-operations","last_synced_at":"2026-05-16T22:09:19.540Z","repository":{"id":56899972,"uuid":"467036055","full_name":"mvr-studio/graphql-codegen-plugin-schema-to-operations","owner":"mvr-studio","description":"GraphQL Codegen plugin for generating queries and mutations out of schema","archived":false,"fork":false,"pushed_at":"2022-03-08T10:31:27.000Z","size":109,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-03-23T22:01:58.033Z","etag":null,"topics":["codegen","graphql","graphql-codegen","plugin"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mvr-studio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-03-07T09:56:44.000Z","updated_at":"2022-03-07T09:59:03.000Z","dependencies_parsed_at":"2022-08-21T02:20:12.351Z","dependency_job_id":null,"html_url":"https://github.com/mvr-studio/graphql-codegen-plugin-schema-to-operations","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvr-studio%2Fgraphql-codegen-plugin-schema-to-operations","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvr-studio%2Fgraphql-codegen-plugin-schema-to-operations/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvr-studio%2Fgraphql-codegen-plugin-schema-to-operations/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvr-studio%2Fgraphql-codegen-plugin-schema-to-operations/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mvr-studio","download_url":"https://codeload.github.com/mvr-studio/graphql-codegen-plugin-schema-to-operations/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244945599,"owners_count":20536297,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["codegen","graphql","graphql-codegen","plugin"],"created_at":"2024-11-28T21:06:17.675Z","updated_at":"2026-05-16T22:09:14.523Z","avatar_url":"https://github.com/mvr-studio.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GraphQL Codegen Plugin Schema To Operations\n\nEasily generate GraphQL operations for provided schema. Our motivation was to create the plugin to create operations for further processing by GraphQL Codegen (in our case to generate SWR and graphql-request SDK out of the box for basic CRUD operations).\n\n## Installation\n\nInstall the module:\n\n```bash\n$ yarn add @mvr-studio/graphql-codegen-plugin-schema-to-operations\n```\n\nAdd it to your codegen.yaml:\n\n```yaml\ngenerates:\n  operations.graphql:\n    schema: ./schema.graphql # or external address pointing to schema\n    plugins:\n      - '@mvr-studio/graphql-codegen-plugin-schema-to-operations'\n```\n\nThat's it. Now you can run the codegen.\n\n## Usage\n\nThe plugin will likely transform given schema:\n\n```gql\nscalar Date\n\ntype AuthResponse {\n  jwt: String!\n}\n\ntype Mutation {\n  logInUser(email: String!, password: String!): AuthResponse\n}\n\ntype Query {\n  me: User\n}\n\nenum Role {\n  ADMIN\n  USER\n}\n\ntype User {\n  id: String!\n  email: String!\n  name: String\n  role: Role\n  createdAt: Date!\n  updatedAt: Date!\n}\n```\n\nInto following operations:\n\n```gql\nquery me_query {\n  me {\n    createdAt\n    email\n    id\n    name\n    role\n    updatedAt\n  }\n}\n\nmutation logInUser_mutation($email: String!, $password: String!) {\n  logInUser(email: $email, password: $password) {\n    jwt\n  }\n}\n```\n\n## Additional Config\n\n### depthLimit\n\nBy default the plugin fetches fields for `depthLimit=1` depth. But the property is adjustable like:\n\n```yaml\ngenerates:\n  operations.graphql:\n    schema: ./schema.graphql # or external address pointing to schema\n    config:\n      depthLimit: 3\n    plugins:\n      - '@mvr-studio/graphql-codegen-plugin-schema-to-operations'\n```\n\n## Credits\n\n[graphql-tools](https://github.com/ardatan/graphql-tools) - Thanks for the [schema processor](https://github.com/ardatan/graphql-tools/blob/master/packages/utils/src/build-operation-for-field.ts)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmvr-studio%2Fgraphql-codegen-plugin-schema-to-operations","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmvr-studio%2Fgraphql-codegen-plugin-schema-to-operations","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmvr-studio%2Fgraphql-codegen-plugin-schema-to-operations/lists"}