{"id":20486861,"url":"https://github.com/rricard/graph-quill","last_synced_at":"2025-09-08T18:38:30.894Z","repository":{"id":57253153,"uuid":"57200177","full_name":"rricard/graph-quill","owner":"rricard","description":"An opinionated but easy way to create GraphQL servers","archived":false,"fork":false,"pushed_at":"2016-05-19T14:01:35.000Z","size":31,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-02T17:12:37.801Z","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/rricard.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":"2016-04-27T09:12:58.000Z","updated_at":"2017-07-18T18:58:12.000Z","dependencies_parsed_at":"2022-08-31T22:20:10.713Z","dependency_job_id":null,"html_url":"https://github.com/rricard/graph-quill","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rricard%2Fgraph-quill","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rricard%2Fgraph-quill/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rricard%2Fgraph-quill/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rricard%2Fgraph-quill/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rricard","download_url":"https://codeload.github.com/rricard/graph-quill/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242063510,"owners_count":20066164,"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":"2024-11-15T16:38:55.552Z","updated_at":"2025-03-05T16:37:26.067Z","avatar_url":"https://github.com/rricard.png","language":"JavaScript","readme":"# GraphQuill\n\nGraphQL Schema creation Sugar\n\n[![Build Status](https://travis-ci.org/rricard/graph-quill.svg?branch=master)](https://travis-ci.org/rricard/graph-quill) [![Code Climate](https://codeclimate.com/github/rricard/graph-quill/badges/gpa.svg)](https://codeclimate.com/github/rricard/graph-quill) [![Issue Count](https://codeclimate.com/github/rricard/graph-quill/badges/issue_count.svg)](https://codeclimate.com/github/rricard/graph-quill)\n\n---\n\nGraphQuill is a tool based on the [GraphQL reference implementation][graphql-js]\nand the [Relay GraphQL supporting Library][graphql-relay-js] which goal is to\nhelp write [GraphQL][graphql] servers compliant with the\n[GraphQL Relay Specification][graphql-relay-spec].\n\n[graphql]: http://graphql.org\n[graphql-js]: https://github.com/graphql/graphql-js\n[graphql-relay-js]: https://github.com/graphql/graphql-relay-js\n[graphql-relay-spec]: https://facebook.github.io/relay/docs/graphql-relay-specification.html\n\n## Example\n\nAs seen in the [tested example][blog-schema], you can \"wrap\" any class like\nyou would\n[add a container around a React component in Relay][relay-container]:\n\n```javascript\nimport GraphQuill from \"graph-quill\"\n\n// Wrap Types\nclass Post {\n  // ...\n}\n\nPost = GraphQuill.createType(Post, {\n  name: \"Post\",\n  description: \"An authored blog post\",\n  idField: \"id\",\n  cursorField: \"creationDate\",\n  resolveById: id =\u003e {\n    // ...\n  },\n}, {\n  title: {\n    type: GraphQLString,\n    description: \"Post's title\",\n  },\n  content: {\n    type: GraphQLString,\n    description: \"Post's markdown contents\",\n  },\n  creationDate: {\n    type: GraphQLString,\n    description: \"Post's creation date\",\n  }\n})\n\n// Wrap Root Queries\nfunction allPosts() {\n  // ...\n}\n\nallPosts = GraphQuill.createRootQueryConnection(allPosts, \"allPosts\", {\n  description: \"Get all of the connected posts\",\n  connectedType: () =\u003e Post,\n})\n\n// Wrap Mutations\nfunction newPost({title, content}, _, {rootValue: {userId}}) {\n  // ...\n  return {\n    newPost: newPost,\n    allPosts: allPosts(),\n  }\n}\n\nnewPost = GraphQuill.createMutation(newPost, {\n  name: \"newPost\",\n  description: \"Creates a new post from the current user\",\n}, {\n  title: {\n    type: new GraphQLNonNull(GraphQLString),\n    description: \"The new post's title\",\n  },\n  content: {\n    type: new GraphQLNonNull(GraphQLString),\n    description: \"The new post's content\",\n  },\n}, {\n  newPost: {\n    type: () =\u003e Post,\n    description: \"The freshly created post\",\n  },\n}, {\n  allPosts: {\n    connectedType: () =\u003e Post,\n    description: \"All of the posts including the new one\",\n  },\n})\n\n// Register in one schema\nexport default GraphQuill.createSchema([\n  Post,\n], [\n  allPosts,\n], [\n  newPost\n])\n```\n\nIn the end, you just end up combining your wrapped types and root queries into\na usable GraphQL Schema.\n\n[blog-schema]: ./test/schemas/blog.js\n[relay-container]: https://facebook.github.io/relay/docs/guides-containers.html\n\n## Installation\n\nThe core GraphQuill package can be easily installed with the following command:\n\n```\nnpm install --save graph-quill\n```\n\n## Roadmap\n\n- **More control over the relay layer** - API design work needed\n- **Babel plugin for parsing comments \u0026 flow annotations** for automatic graphql\nschema inference\n\n## Contributing\n\nGraphQuill is still at early stages but you are encouraged to help!\n\nFeature requests are not a priority though as I am maintaining this alone for\nnow. If you want to add a feature, please send me a Pull-Request containing\nthe feature and associated tests. If you want to be sure to see your feature\naccepted, create an issue to discuss it.\n\nBug reports are welcome if you provide clear context information and steps to\nreproduce.\n\nBug fixes are always welcome!\n\nThe CI servers will ensure correct typechecking as well as passing tests and\nlinted code. Make sure it works on your side too using:\n\n- `npm run typecheck`\n- `npm test`\n- `npm run lint`\n\n## Author\n\nRobin Ricard\n\n## Licence\n\n```\nThe MIT License (MIT)\n\nCopyright (c) 2016 Robin Ricard\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frricard%2Fgraph-quill","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frricard%2Fgraph-quill","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frricard%2Fgraph-quill/lists"}