{"id":13499149,"url":"https://github.com/SimonDegraeve/hapi-graphql","last_synced_at":"2025-03-29T04:30:35.522Z","repository":{"id":57123548,"uuid":"40720993","full_name":"SimonDegraeve/hapi-graphql","owner":"SimonDegraeve","description":"Create a GraphQL HTTP server with Hapi.","archived":false,"fork":false,"pushed_at":"2018-02-22T14:41:12.000Z","size":41,"stargazers_count":114,"open_issues_count":8,"forks_count":27,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-28T10:21:16.563Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SimonDegraeve.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-08-14T15:05:14.000Z","updated_at":"2025-02-11T21:32:03.000Z","dependencies_parsed_at":"2022-08-27T09:11:00.707Z","dependency_job_id":null,"html_url":"https://github.com/SimonDegraeve/hapi-graphql","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/SimonDegraeve%2Fhapi-graphql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimonDegraeve%2Fhapi-graphql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimonDegraeve%2Fhapi-graphql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimonDegraeve%2Fhapi-graphql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SimonDegraeve","download_url":"https://codeload.github.com/SimonDegraeve/hapi-graphql/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246009131,"owners_count":20708917,"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-07-31T22:00:29.963Z","updated_at":"2025-03-29T04:30:35.218Z","avatar_url":"https://github.com/SimonDegraeve.png","language":"JavaScript","funding_links":[],"categories":["Libraries","Implementations"],"sub_categories":["JavaScript Libraries","JavaScript/TypeScript"],"readme":"# GraphQL Hapi Plugin\n\nCreate a GraphQL HTTP server with [Hapi](http://hapijs.com).\nPort from [express-graphql](https://github.com/graphql/express-graphql).\n\n```js\nnpm install --save hapi-graphql\n```\n\n### Example\n\n```js\nimport Hapi from 'hapi';\nimport GraphQL from 'hapi-graphql';\nimport {GraphQLSchema} from 'graphql';\n\nconst server = new Hapi.Server();\nserver.connection({\n  port: 3000\n});\n\nconst TestSchema = new GraphQLSchema({});\n\nserver.register({\n  register: GraphQL,\n  options: {\n    query: {\n      # options, see below\n    },\n    // OR\n    //\n    // query: (request) =\u003e ({\n    //   # options, see below\n    // }),\n    route: {\n      path: '/graphql',\n      config: {}\n    }\n  }\n}, () =\u003e\n  server.start(() =\u003e\n    console.log('Server running at:', server.info.uri)\n  )\n);\n```\n\n### Options\n\nThe `options` key of `query` accepts the following:\n\n  * **`schema`**: A `GraphQLSchema` instance from [`graphql-js`][].\n    A `schema` *must* be provided.\n\n  * **`context`**: A value to pass as the `context` to the `graphql()`\n    function from [`graphql-js`][].\n\n  * **`rootValue`**: A value to pass as the `rootValue` to the `graphql()`\n    function from [`graphql-js`][].\n\n  * **`pretty`**: If `true`, any JSON response will be pretty-printed.\n\n  * **`formatError`**: An optional function which will be used to format any\n    errors produced by fulfilling a GraphQL operation. If no function is\n    provided, GraphQL's default spec-compliant [`formatError`][] function will\n    be used.\n\n  * **`validationRules`**: Optional additional validation rules queries must\n    satisfy in addition to those defined by the GraphQL spec.\n\n  * **`graphiql`**: If `true`, may present [GraphiQL][] when loaded directly\n    from a browser (a useful tool for debugging and exploration).\n\n#### Debugging\n\nDuring development, it's useful to get more information from errors, such as\nstack traces. Providing a function to `formatError` enables this:\n\n```js\nformatError: error =\u003e ({\n  message: error.message,\n  locations: error.locations,\n  stack: error.stack\n})\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSimonDegraeve%2Fhapi-graphql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSimonDegraeve%2Fhapi-graphql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSimonDegraeve%2Fhapi-graphql/lists"}