{"id":21536096,"url":"https://github.com/littlstar/gqlc","last_synced_at":"2025-03-17T20:25:25.402Z","repository":{"id":57252899,"uuid":"49501017","full_name":"littlstar/gqlc","owner":"littlstar","description":"GraphQL Schema Compiler","archived":false,"fork":false,"pushed_at":"2016-01-15T21:39:05.000Z","size":32,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-16T02:05:48.041Z","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/littlstar.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-01-12T13:15:00.000Z","updated_at":"2016-11-23T01:10:55.000Z","dependencies_parsed_at":"2022-08-31T22:20:43.016Z","dependency_job_id":null,"html_url":"https://github.com/littlstar/gqlc","commit_stats":null,"previous_names":["jwerle/gqlc"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/littlstar%2Fgqlc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/littlstar%2Fgqlc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/littlstar%2Fgqlc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/littlstar%2Fgqlc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/littlstar","download_url":"https://codeload.github.com/littlstar/gqlc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243817896,"owners_count":20352626,"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-24T03:18:03.624Z","updated_at":"2025-03-17T20:25:25.381Z","avatar_url":"https://github.com/littlstar.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gqlc\n\nGraphQL Schema Compiler\n\n**GraphQLC** (or GQLC) is built on\n[GraphQL.js](https://github.com/graphql/graphql-js) and\nleverages the schema language parser built into GraphQL. GQLC allows users\nto define their schemas using the language defined by the [GraphQL\nSpec](https://facebook.github.io/graphql), bind implementations for\nroutines for resolving data, and get a `GraphQLSchema` object to pass\ndirectly to the `graphql()` function. This allows authors to focus on the\nimplementation details of their graph data set.\n\n## Supported schema language features\n\n* InterfaceTypeDefinition\n* ObjectTypeDefinition\n* EnumTypeDefinition\n* UnionTypeDefinition\n* InputObjectTypeDefinition\n* TypeExtensionDefinition\n\n## Installation\n\nGQLC is written in ES6 and intended to be used with\n[GraphQL.js](https://github.com/graphql/graphql-js) in a Node.js\nenvironment.\n\n```sh\n$ npm install --save gqlc\n```\n\n## Hello World\n\nBelow is a simple hello world that query the graph for a fixed resolved value.\n\n```js\nimport { graphql } from 'graphql'\nimport gqlc from 'gqlc'\n\nconst implementation = {\n  Query: {\n    fields: () =\u003e ({\n      hello: { resolve () { return 'world' } }\n    })\n  }\n}\n\nconst Schema = `type Query { hello: String }`\nconst query = `query { hello }`\n\ngqlc(implementation)\n.compile(Schema)\n.then((schema) =\u003e graphql(schema, query))\n.then((result) =\u003e console.log(result)) // { data: { hello: 'world' } }\n.catch((error) =\u003e console.error(error))\n```\n\n## Examples\n\n* [Basic](examples/basic)\n* [Advanced](examples/advanced)\n\n## Usage\n\nThe `gqlc()` function accepts an optional initial state object and a\nrequired implementation object. The return value of the `gqlc()` function\nrepresents the current state of the schema definition. A GraphQL schema can\nbe compiled by calling the `.compile()` method on the state object returned\nby the `gqlc()` function. A `Promise` providing an instance the `GraphQLSchema`\nobject is returned. It can be used directly with the `graphql()`\nfunction.\n\n```js\nconst state = gqlc([initialState,]implementation)\nstate.compile(schemaSource).then((schema) =\u003e graphql(schema, query))\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flittlstar%2Fgqlc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flittlstar%2Fgqlc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flittlstar%2Fgqlc/lists"}