{"id":29022989,"url":"https://github.com/bamlab/react-native-graphql-transformer","last_synced_at":"2025-06-26T03:04:56.142Z","repository":{"id":27382689,"uuid":"113690843","full_name":"bamlab/react-native-graphql-transformer","owner":"bamlab","description":"Transform GraphQL source files","archived":false,"fork":false,"pushed_at":"2022-12-07T10:22:37.000Z","size":176,"stargazers_count":22,"open_issues_count":8,"forks_count":8,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-06-02T14:55:32.343Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/bamlab.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":"2017-12-09T18:14:46.000Z","updated_at":"2023-08-12T21:45:09.000Z","dependencies_parsed_at":"2023-01-14T06:37:34.532Z","dependency_job_id":null,"html_url":"https://github.com/bamlab/react-native-graphql-transformer","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/bamlab/react-native-graphql-transformer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bamlab%2Freact-native-graphql-transformer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bamlab%2Freact-native-graphql-transformer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bamlab%2Freact-native-graphql-transformer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bamlab%2Freact-native-graphql-transformer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bamlab","download_url":"https://codeload.github.com/bamlab/react-native-graphql-transformer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bamlab%2Freact-native-graphql-transformer/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261897103,"owners_count":23226657,"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":[],"created_at":"2025-06-26T03:04:51.414Z","updated_at":"2025-06-26T03:04:56.132Z","avatar_url":"https://github.com/bamlab.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-native-graphql-transformer\n\n[![All Contributors](https://img.shields.io/badge/all_contributors-7-orange.svg?style=flat-square)](#contributors)\n\nSeamlessly use GraphQL files with react-native \u003e= 0.45\n\n## Foreword\n\nThis package is inspired by the\n[react-native-typescript-transform](https://github.com/ds300/react-native-typescript-transformer)\nrepository.\n\n## Goal\n\nUse `.gql`or `.graphql` files with React Native packager for better readability\nand separation of concerns.\n\n**Exemple of a `.gql` file with import statement:**\n\n```gql\n#import \"fragments/BasePost.gql\"\n\nquery PostListItemQuery($id: ID) {\n  Post(id: $id) {\n    ...BasePost\n  }\n}\n```\n\n## Usage\n\n### Step 1: Install\n\n    yarn add -D @bam.tech/react-native-graphql-transformer\n\n### Step 2: Configure the react native packager\n\nAdd this to your rn-cli.config.js (make one if you don't have one already):\n\n#### react-native 0.57 or later\n\n```js\nconst { getDefaultConfig } = require('metro-config');\n\nmodule.exports = (async () =\u003e {\n  const {\n    resolver: { sourceExts },\n  } = await getDefaultConfig();\n  return {\n    transformer: {\n      babelTransformerPath: require.resolve(\n        '@bam.tech/react-native-graphql-transformer'\n      ),\n    },\n    resolver: {\n      sourceExts: [...sourceExts, 'gql', 'graphql'],\n    },\n  };\n})();\n```\n\n#### react-native 0.56 or earlier\n\n```js\nmodule.exports = {\n  getTransformModulePath() {\n    return require.resolve('@bam.tech/react-native-graphql-transformer');\n  },\n  getSourceExts() {\n    return ['gql', 'graphql'];\n  }\n};\n```\n\n### Step 3: Write GraphQL code!\n\n## Contributors\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore --\u003e\n| [\u003cimg src=\"https://avatars1.githubusercontent.com/u/16262904?v=4\" width=\"100px;\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eThomas Pucci\u003c/b\u003e\u003c/sub\u003e](https://github.com/tpucci)\u003cbr /\u003e[💻](https://github.com/bamlab/react-native-graphql-transformer/commits?author=tpucci \"Code\") [📖](https://github.com/bamlab/react-native-graphql-transformer/commits?author=tpucci \"Documentation\") [💡](#example-tpucci \"Examples\") | [\u003cimg src=\"https://avatars2.githubusercontent.com/u/13785185?v=4\" width=\"100px;\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eTychoTa\u003c/b\u003e\u003c/sub\u003e](https://twitter.com/TychoTa)\u003cbr /\u003e[💻](https://github.com/bamlab/react-native-graphql-transformer/commits?author=tychota \"Code\") | [\u003cimg src=\"https://avatars2.githubusercontent.com/u/9041221?v=4\" width=\"100px;\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eClément Taboulot\u003c/b\u003e\u003c/sub\u003e](https://github.com/taboulot)\u003cbr /\u003e[💻](https://github.com/bamlab/react-native-graphql-transformer/commits?author=taboulot \"Code\") | [\u003cimg src=\"https://avatars0.githubusercontent.com/u/5304092?v=4\" width=\"100px;\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003earolson101\u003c/b\u003e\u003c/sub\u003e](https://github.com/arolson101)\u003cbr /\u003e[💡](#example-arolson101 \"Examples\") | [\u003cimg src=\"https://avatars1.githubusercontent.com/u/14874974?v=4\" width=\"100px;\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eajubin\u003c/b\u003e\u003c/sub\u003e](https://github.com/ajubin)\u003cbr /\u003e[💻](https://github.com/bamlab/react-native-graphql-transformer/commits?author=ajubin \"Code\") | [\u003cimg src=\"https://avatars1.githubusercontent.com/u/13874?v=4\" width=\"100px;\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eGerard de Brieder\u003c/b\u003e\u003c/sub\u003e](https://github.com/smeevil)\u003cbr /\u003e[🐛](https://github.com/bamlab/react-native-graphql-transformer/issues?q=author%3Asmeevil \"Bug reports\") | [\u003cimg src=\"https://avatars3.githubusercontent.com/u/1211?v=4\" width=\"100px;\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003emike castleman\u003c/b\u003e\u003c/sub\u003e](https://mlcastle.net/)\u003cbr /\u003e[📖](https://github.com/bamlab/react-native-graphql-transformer/commits?author=mlc \"Documentation\") |\n| :---: | :---: | :---: | :---: | :---: | :---: | :---: |\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbamlab%2Freact-native-graphql-transformer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbamlab%2Freact-native-graphql-transformer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbamlab%2Freact-native-graphql-transformer/lists"}