{"id":13880723,"url":"https://github.com/Econify/graphql-request-profiler","last_synced_at":"2025-07-16T17:31:01.653Z","repository":{"id":38440721,"uuid":"493438055","full_name":"Econify/graphql-request-profiler","owner":"Econify","description":"Easy to use GraphQL performance analysis utility for tracing resolver execution time","archived":false,"fork":false,"pushed_at":"2023-07-11T01:13:45.000Z","size":544,"stargazers_count":56,"open_issues_count":7,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-06-11T20:27:54.634Z","etag":null,"topics":["apollo","express","express-graphql","graphql","performance","plugin","profiler","visualizer"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/Econify.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-05-17T22:58:34.000Z","updated_at":"2024-04-29T22:27:32.000Z","dependencies_parsed_at":"2024-11-24T09:32:46.211Z","dependency_job_id":null,"html_url":"https://github.com/Econify/graphql-request-profiler","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/Econify/graphql-request-profiler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Econify%2Fgraphql-request-profiler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Econify%2Fgraphql-request-profiler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Econify%2Fgraphql-request-profiler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Econify%2Fgraphql-request-profiler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Econify","download_url":"https://codeload.github.com/Econify/graphql-request-profiler/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Econify%2Fgraphql-request-profiler/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265527544,"owners_count":23782480,"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":["apollo","express","express-graphql","graphql","performance","plugin","profiler","visualizer"],"created_at":"2024-08-06T08:03:25.610Z","updated_at":"2025-07-16T17:31:01.647Z","avatar_url":"https://github.com/Econify.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# graphql-request-profiler\n\n![Status Checks](https://github.com/Econify/graphql-request-profiler/actions/workflows/checks.yml/badge.svg)\n\nEasy to use GraphQL performance analysis utility for profiling resolver execution time. Observe resolver execution time in your API with a visualization tool.\n\n## Example\n\n```sh\ngraphql-request-profiler -s examples/operation.graphql -e http://localhost:4000/graphql\n```\n\n![Sample Visualizer](https://github.com/Econify/graphql-request-profiler/raw/main/sample.png)\n\n## Installation\n\nFor CLI usage with API that has the plugin installed:\n\n```sh\nnpm i -g @econify/graphql-request-profiler\n```\n\nWithin a project:\n\n```sh\nnpm install --save @econify/graphql-request-profiler\n```\n\n```sh\nyarn add @econify/graphql-request-profiler\n```\n\n### CLI Usage\n\n```\n$ graphql-request-profiler --help\ngraphql-request-profiler: Visualize your GraphQL resolver execution time - Version 0.2.0\n\nUsage:\n\n  graphql-request-profiler --data \u003cfileName\u003e\n  graphql-request-profiler --schema operation.graphql --endpoint=localhost:4000/graphql\n  graphql-request-profiler --help\n\nArguments:\n\n  --schema, -s (file path)        requesting schema file location\n  --output, -o (file path)        output request data to file location\n  --endpoint, -e (string)         the endpoint of the GraphQL server to request\n  --variables, -v (file path)     variables to pass to the GraphQL server\n  --operationName, -n (string)    optional, name of the operation to use in the schema\n  --headerName, -h (string)       optional, the name of the header to activate\n\n  --data, -d (string)             display an existing trace file\n  --help (boolean)                displays this help text\n\n```\n\n### graphql-http\n\n```js\nimport { createHandler } from 'graphql-http/lib/use/http';\nimport { createHttpHandlerProfilerPlugin } from '@econify/graphql-request-profiler';\n\nconst server = http.createServer((req, res) =\u003e {\n  if (req.url?.startsWith('/graphql')) {\n    createHandler(\n      createHttpHandlerProfilerPlugin(req, {\n        schema: buildSchema(),\n      })\n    )(req, res);\n  } else {\n    res.writeHead(404).end();\n  }\n});\n\nserver.listen(4000);\nconsole.log('Listening to port 4000');\n```\n\nSee [full running example here](https://github.com/Econify/graphql-request-profiler/blob/main/packages/plugin/examples/graphql-http/http.ts)\nSee [example of graphql-http with express](https://github.com/Econify/graphql-request-profiler/blob/main/packages/plugin/examples/graphql-http/express.ts)\n\n### apollo-server\n\n```js\nimport { createApolloProfilerPlugin } from '@econify/graphql-request-profiler';\n\nconst server = new ApolloServer({\n  schema: buildSchema(),\n  plugins: [createApolloProfilerPlugin()],\n});\n\nserver.listen().then(({ url }) =\u003e {\n  console.log(`Listening on ${url}`);\n});\n```\n\nSee [full running example here](https://github.com/Econify/graphql-request-profiler/blob/main/packages/plugin/examples/apollo/index.ts)\n\n#### Deprecated\n\n### express-graphql\n\n```js\nimport { createExpressProfilerPlugin } from '@econify/graphql-request-profiler';\n\nconst app = express();\n\napp.use(\n  '/graphql',\n  graphqlHTTP((req) =\u003e\n    createExpressProfilerPlugin(req, {\n      schema,\n      graphiql: true,\n    })\n  )\n);\n```\n\nSee [full running example here](https://github.com/Econify/graphql-request-profiler/blob/main/packages/plugin/examples/express-graphql/index.ts)\n\n### Custom Activation Header\n\nIf the server requires a different HTTP header to activate the plugin besides `x-trace`, a custom header name can be specified in the configuration to the plugin.\n\n```js\ncreateApolloProfilerPlugin({ headerName: 'x-custom-header' });\ncreateExpressProfilerPlugin(req, options, { headerName: 'x-custom-header' });\n```\n\nA custom plugin activation HTTP header may be specified when using the CLI tool.\n\n```sh\ngraphql-request-profiler --headerName x-custom-header [...]\n```\n\n## Like this package?\n\nCheck out Econify's other GraphQL package, [graphql-rest-router](https://www.github.com/Econify/graphql-rest-router), that allows routing to and caching an internal GraphQL API as a self-documenting REST API without exposing the schema!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FEconify%2Fgraphql-request-profiler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FEconify%2Fgraphql-request-profiler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FEconify%2Fgraphql-request-profiler/lists"}