{"id":15809219,"url":"https://github.com/zordius/graphql-endpoint","last_synced_at":"2026-02-12T09:31:48.292Z","repository":{"id":46942451,"uuid":"143117530","full_name":"zordius/graphql-endpoint","owner":"zordius","description":"A lightweight framework for GraphQL endpoints ","archived":false,"fork":false,"pushed_at":"2023-01-03T15:16:44.000Z","size":597,"stargazers_count":1,"open_issues_count":12,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-15T12:31:01.349Z","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/zordius.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":"2018-08-01T07:07:43.000Z","updated_at":"2022-10-26T02:52:03.000Z","dependencies_parsed_at":"2023-02-01T07:01:11.517Z","dependency_job_id":null,"html_url":"https://github.com/zordius/graphql-endpoint","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zordius/graphql-endpoint","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zordius%2Fgraphql-endpoint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zordius%2Fgraphql-endpoint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zordius%2Fgraphql-endpoint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zordius%2Fgraphql-endpoint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zordius","download_url":"https://codeload.github.com/zordius/graphql-endpoint/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zordius%2Fgraphql-endpoint/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29362786,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-12T08:51:36.827Z","status":"ssl_error","status_checked_at":"2026-02-12T08:51:26.849Z","response_time":55,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-10-05T03:20:33.849Z","updated_at":"2026-02-12T09:31:48.277Z","avatar_url":"https://github.com/zordius.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# graphql-endpoint\n[![Build Status](https://travis-ci.org/zordius/graphql-endpoint.svg?branch=master)](https://travis-ci.org/zordius/graphql-endpoint) A lightweight framework for GraphQL endpoints.\n\n**Before (client)**:\n```javascript\nfetch('somewhere/graphql', {\n  method: 'POST',\n  headers: {\n    'content-type': 'application/json',\n  },\n  body: JSON.stringify({ bigGraphQLQueryString, variables })\n).then(response =\u003e response.json()) // receive GraphQLResult\n```\n\n**After (client)**:\n```javascript\n// put GraphQL variables into http GET queris\nfetch('somewhere/wrapped/endpoint?variable1=abc\u0026variable2=def')\n.then(response =\u003e response.json()) // receive GraphQLResult\n\n// or make GraphQL like POST without query\nfetch('somehwere/wrapped/endpoint', {\n  method: 'POST',\n  headers: {\n    'content-type': 'application/json',\n  },\n  body: JSON.stringify({ variables }) // no need query, it's on server side\n).then(response =\u003e response.json()) // receive GraphQLResult\n```\n\n## Why?\n\n* Reduce your client side request size by moving your GraphQL query from client side to server side.\n* Keep your GraphQL queries at server side safely.\n* Update your GraphQL queries at server side without publishing new client applications.\n\n## Usage\n\nAdd `graphql-endpoint` to your GraphQL server.\n\n```javascript\nconst { ApolloServer } = require('apollo-server-express')\nconst express = require('express')\nconst { GraphQLEndpoint } = require('graphql-endpoint')\nconst bodyParser = require('body-parser')\n\nconst app = express()\n\n// graphql-endpoint requires json body to be parsed\napp.use(bodyParser.json())\n// Adopt graphql-endpoint\nGraphQLEndpoint(app)\n\nconst server = new ApolloServer(configs)\nserver.applyMiddleware({\n  app,\n  bodyParser: false // optional disable bodyParser, we already have it\n})\n```\n\nThen put your GraphQL query files into `src/endpoints/`. For example, the `src/endpoints/my_api` with content `{ example(id: 123) { title, description } }` will serve GraphQL result on `/my_api` .\n\nThe wrapped API endpoint will support two types of http requests:\n\n* simple http GET: the http GET queries will be collected into GraphQL variables then be sent to GraphQL server with server side predefined GraphQL query.\n* http POST: the http POST body be merged with server side predefined query, then be sent to GraphQL server.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzordius%2Fgraphql-endpoint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzordius%2Fgraphql-endpoint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzordius%2Fgraphql-endpoint/lists"}