{"id":14976133,"url":"https://github.com/graphql-community/graphql-directive-uid","last_synced_at":"2025-07-02T03:32:56.684Z","repository":{"id":30604329,"uuid":"125504229","full_name":"graphql-community/graphql-directive-uid","owner":"graphql-community","description":"Generate uid for GraphQL schema","archived":false,"fork":false,"pushed_at":"2022-12-08T17:17:46.000Z","size":1235,"stargazers_count":23,"open_issues_count":22,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-05-26T13:54:08.190Z","etag":null,"topics":["directive","graphql","graphql-directive","graphql-js","graphql-schema"],"latest_commit_sha":null,"homepage":"","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/graphql-community.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":"2018-03-16T10:56:37.000Z","updated_at":"2021-12-31T17:22:10.000Z","dependencies_parsed_at":"2023-01-14T17:30:17.854Z","dependency_job_id":null,"html_url":"https://github.com/graphql-community/graphql-directive-uid","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/graphql-community/graphql-directive-uid","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphql-community%2Fgraphql-directive-uid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphql-community%2Fgraphql-directive-uid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphql-community%2Fgraphql-directive-uid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphql-community%2Fgraphql-directive-uid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/graphql-community","download_url":"https://codeload.github.com/graphql-community/graphql-directive-uid/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphql-community%2Fgraphql-directive-uid/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262493805,"owners_count":23319920,"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":["directive","graphql","graphql-directive","graphql-js","graphql-schema"],"created_at":"2024-09-24T13:53:22.190Z","updated_at":"2025-07-02T03:32:56.644Z","avatar_url":"https://github.com/graphql-community.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# graphql-directive-uid\n\nUnique `id` directive for GraphQL schema.\n\n[![Version][version-badge]][package]\n[![downloads][downloads-badge]][npmtrends]\n\n[![PRs Welcome][prs-badge]][prs]\n[![MIT License][license-badge]][build]\n\n## The problem\n\nGenerating unique `id` for each graphql schema type may be a daunting task.\n\n## This solution\n\nThe `@uid` is a GraphQL directive allowing users to generate unique IDs for their queries. All benefits of GraphQL cache with minimum effort.\n\n## Table of Contents\n\n\u003c!-- START doctoc generated TOC please keep comment here to allow auto update --\u003e\n\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --\u003e\n\n* [Installation](#installation)\n* [Usage](#usage)\n* [More on `data-testid`s](#more-on-data-testids)\n* [Examples](#examples)\n* [LICENSE](#license)\n\n\u003c!-- END doctoc generated TOC please keep comment here to allow auto update --\u003e\n\n## Installation\n\nThis module is distributed via [npm][npm] which is bundled with [node][node] and\nshould be installed as one of your project's `devDependencies`:\n\nuse npm:\n\n```\nnpm install --save graphql-directive-uid\n```\n\nor yarn :\n\n```\nyarn add graphql-directive-uid\n```\n\nThis library has a `peerDependencies` listing for:\n\n* `graphql`\n* `graphql-tools`\n\n## Usage\n\n```javascript\nimport { makeExecutableSchema } from 'graphql-tools';\nimport graphqlDirectiveUid from 'graphql-directive-uid';\nimport typeDefs from './schema.graphql';\nimport resolvers from './resolvers';\n\nexport default makeExecutableSchema({\n  typeDefs,\n  resolvers,\n  schemaDirectives: {\n    uid: graphqlDirectiveUid, // the name of directive can be as you like\n  },\n});\n```\n\nGraphQL schema:\n\n```graphql\ntype Person @uid(from: [\"personId\", \"name\"]) {\n  personId: Int\n  name: String\n}\n\ntype Query {\n  persons: [Person]\n}\n```\n\nGraphQL query:\n\n```graphql\nquery getPersons {\n  persons {\n    uid\n    personId\n    name\n  }\n}\n```\n\n## Examples\n\nYou'll find examples of how to use it in \n[the test directory](https://github.com/graphql-community/graphql-directive-uid/blob/master/example/__tests__).\n\nFeel free to contribute more!\n\n## LICENSE\n\nMIT\n\n[npm]: https://www.npmjs.com/\n[node]: https://nodejs.org\n[build-badge]: https://img.shields.io/travis/graphql-community/graphql-directive-uid.svg?style=flat-square\n[build]: https://travis-ci.org/graphql-community/graphql-directive-uid\n[coverage-badge]: https://img.shields.io/codecov/c/github/graphql-community/graphql-directive-uid.svg?style=flat-square\n[coverage]: https://codecov.io/github/graphql-community/graphql-directive-uid\n[version-badge]: https://img.shields.io/npm/v/graphql-directive-uid.svg?style=flat-square\n[package]: https://www.npmjs.com/package/graphql-directive-uid\n[downloads-badge]: https://img.shields.io/npm/dm/graphql-directive-uid.svg?style=flat-square\n[npmtrends]: http://www.npmtrends.com/graphql-directive-uid\n[license-badge]: https://img.shields.io/npm/l/graphql-directive-uid.svg?style=flat-square\n[license]: https://github.com/graphql-community/graphql-directive-uid/blob/master/LICENSE\n[prs-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square\n[prs]: http://makeapullrequest.com\n[donate-badge]: https://img.shields.io/badge/$-support-green.svg?style=flat-square\n[coc-badge]: https://img.shields.io/badge/code%20of-conduct-ff69b4.svg?style=flat-square\n[coc]: https://github.com/graphql-community/graphql-directive-uid/blob/master/CODE_OF_CONDUCT.md\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraphql-community%2Fgraphql-directive-uid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgraphql-community%2Fgraphql-directive-uid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraphql-community%2Fgraphql-directive-uid/lists"}