{"id":23626137,"url":"https://github.com/cerberus/apollo-persisted-hash","last_synced_at":"2026-04-28T12:02:45.687Z","repository":{"id":57182370,"uuid":"203553763","full_name":"Cerberus/apollo-persisted-hash","owner":"Cerberus","description":"Apollo cli for apollo-link-persisted-link","archived":false,"fork":false,"pushed_at":"2020-07-18T01:42:06.000Z","size":165,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-03-29T14:49:26.468Z","etag":null,"topics":["apollo","apollo-cli","graphql"],"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/Cerberus.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2019-08-21T09:41:41.000Z","updated_at":"2019-08-22T12:25:04.000Z","dependencies_parsed_at":"2022-09-11T23:50:35.234Z","dependency_job_id":null,"html_url":"https://github.com/Cerberus/apollo-persisted-hash","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Cerberus/apollo-persisted-hash","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cerberus%2Fapollo-persisted-hash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cerberus%2Fapollo-persisted-hash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cerberus%2Fapollo-persisted-hash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cerberus%2Fapollo-persisted-hash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Cerberus","download_url":"https://codeload.github.com/Cerberus/apollo-persisted-hash/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cerberus%2Fapollo-persisted-hash/sbom","scorecard":{"id":28114,"data":{"date":"2025-08-11","repo":{"name":"github.com/Cerberus/apollo-persisted-hash","commit":"7f87f284d15c9b615beb3c52c01cfe04cdda2a50"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.3,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/13 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"24 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-m744-2jj8-vpfv","Warn: Project is vulnerable to: GHSA-pfrx-2q88-qq97","Warn: Project is vulnerable to: GHSA-rc47-6667-2j5j","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-8hfj-j24r-96c4","Warn: Project is vulnerable to: GHSA-wc69-rhjr-hc9g","Warn: Project is vulnerable to: GHSA-w7rc-rwvf-8q5r","Warn: Project is vulnerable to: GHSA-r683-j2x4-v87g","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-4rq4-32rv-6wp6","Warn: Project is vulnerable to: GHSA-64g7-mvw6-v9qj","Warn: Project is vulnerable to: GHSA-hjxc-462x-x77j","Warn: Project is vulnerable to: GHSA-5xf4-f2fq-f69j","Warn: Project is vulnerable to: GHSA-8mfc-v7wv-p62g","Warn: Project is vulnerable to: GHSA-mpwj-fcr6-x34c"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-14T18:24:13.705Z","repository_id":57182370,"created_at":"2025-08-14T18:24:13.705Z","updated_at":"2025-08-14T18:24:13.705Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32379629,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-28T11:25:28.583Z","status":"ssl_error","status_checked_at":"2026-04-28T11:25:05.435Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["apollo","apollo-cli","graphql"],"created_at":"2024-12-27T22:51:22.241Z","updated_at":"2026-04-28T12:02:45.653Z","avatar_url":"https://github.com/Cerberus.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Forked from [apollo](https://www.npmjs.com/package/apollo)\n\nThe main purpose of this repo is for supporting [apollo-link-persisted-queries](https://github.com/apollographql/apollo-link-persisted-queries) when prefer to use **white-list** query on server-side.\n\nDisclaimer: I have no plan to maintain this. but may open a pull-request to the origin.\n\n## How to make persisted hash with apollo-link-persisted-queries\n\n1). Implement a new custom `gql` instead of `graphql-tag`\n\n```ts\nimport graphqlTag from 'graphql-tag'\nimport { sortDefinitions } from 'apollo-persisted-hash/lib/utils/document'\n\nexport const gql = (literals: TemplateStringsArray, ...placeholders: any[]) =\u003e {\n\tconst document = graphqlTag(literals, ...placeholders)\n\tconst sortedDefinitionsDocument = sortDefinitions(document)\n\tdocument.hash = defaultGenerateHash(sortedDefinitionsDocument)\n\treturn document\n}\n```\n\n2). Pass this custom `generateHash` to `createPersistedQueryLink`\n\n```ts\ncreatePersistedQueryLink({\n\tgenerateHash: (document: any) =\u003e {\n\t\treturn document.hash\n\t},\n})\n```\n\n3). Enjoy\n\n✨ Wow, the persisted hash will be calculated on parse time, it make faster. But it only support the project that using whole static query.\n\n# Apollo CLI\n\n[![GitHub license](https://img.shields.io/badge/license-MIT-lightgrey.svg?maxAge=2592000)](https://raw.githubusercontent.com/apollographql/apollo-tooling/master/LICENSE) [![npm](https://img.shields.io/npm/v/apollo.svg)](https://www.npmjs.com/package/apollo) [![Get on Slack](https://img.shields.io/badge/spectrum-join-orange.svg)](https://spectrum.chat/apollo?tab=posts)\n\nApollo CLI brings together your GraphQL clients and servers with tools for validating your schema, linting your operations for compatibility with your server, and generating static types for improved client-side type safety.\n\n\u003c!-- toc --\u003e\n\n- [Apollo CLI](#apollo-cli)\n- [Usage](#usage)\n- [Commands](#commands)\n- [Configuration](#configuration)\n- [Code Generation](#code-generation)\n- [Contributing](#contributing)\n  \u003c!-- tocstop --\u003e\n\n# Usage\n\n\u003c!-- usage --\u003e\n\n```sh-session\n$ npm install -g apollo\n$ apollo COMMAND\nrunning command...\n$ apollo (-v|--version|version)\napollo/2.18.0 darwin-x64 node-v8.11.1\n$ apollo --help [COMMAND]\nUSAGE\n  $ apollo COMMAND\n...\n```\n\n\u003c!-- usagestop --\u003e\n\n# Commands\n\n\u003c!-- commands --\u003e\n\n- [`apollo client:check`](#apollo-clientcheck)\n- [`apollo client:codegen [OUTPUT]`](#apollo-clientcodegen-output)\n- [`apollo client:download-schema OUTPUT`](#apollo-clientdownload-schema-output)\n- [`apollo client:extract OUTPUT`](#apollo-clientextract-output)\n- [`apollo client:push`](#apollo-clientpush)\n- [`apollo help [COMMAND]`](#apollo-help-command)\n- [`apollo plugins`](#apollo-plugins)\n- [`apollo plugins:install PLUGIN...`](#apollo-pluginsinstall-plugin)\n- [`apollo plugins:link PLUGIN`](#apollo-pluginslink-plugin)\n- [`apollo plugins:uninstall PLUGIN...`](#apollo-pluginsuninstall-plugin)\n- [`apollo plugins:update`](#apollo-pluginsupdate)\n- [`apollo service:check`](#apollo-servicecheck)\n- [`apollo service:delete`](#apollo-servicedelete)\n- [`apollo service:download OUTPUT`](#apollo-servicedownload-output)\n- [`apollo service:list`](#apollo-servicelist)\n- [`apollo service:push`](#apollo-servicepush)\n\n## `apollo client:check`\n\nCheck a client project against a pushed service\n\n```\nUSAGE\n  $ apollo client:check\n\nOPTIONS\n  -c, --config=config                    Path to your Apollo config file\n  -t, --tag=tag                          The published service tag for this client\n  --clientName=clientName                Name of the client that the queries will be attached to\n\n  --clientReferenceId=clientReferenceId  Reference id for the client which will match ids from client traces, will use\n                                         clientName if not provided\n\n  --clientVersion=clientVersion          The version of the client that the queries will be attached to\n\n  --endpoint=endpoint                    The url of your service\n\n  --excludes=excludes                    Glob of files to exclude for GraphQL operations. Caveat: this doesn't currently\n                                         work in watch mode\n\n  --header=header                        Additional header to send to server for introspectionQuery. May be used\n                                         multiple times to add multiple headers. NOTE: The `--endpoint` flag is REQUIRED\n                                         if using the `--header` flag.\n\n  --includes=includes                    Glob of files to search for GraphQL operations. This should be used to find\n                                         queries *and* any client schema extensions\n\n  --key=key                              The API key for the Apollo Engine service\n\n  --queries=queries                      Deprecated in favor of the includes flag\n\n  --tagName=tagName                      Name of the template literal tag used to identify template literals containing\n                                         GraphQL queries in Javascript/Typescript code\n```\n\n_See code: [src/commands/client/check.ts](https://github.com/apollographql/apollo-tooling/blob/master/packages/apollo/src/commands/client/check.ts)_\n\n## `apollo client:codegen [OUTPUT]`\n\nGenerate static types for GraphQL queries. Can use the published schema in Apollo Engine or a downloaded schema.\n\n```\nUSAGE\n  $ apollo client:codegen [OUTPUT]\n\nARGUMENTS\n  OUTPUT\n      Directory to which generated files will be written.\n      - For TypeScript/Flow generators, this specifies a directory relative to each source file by default.\n      - For TypeScript/Flow generators with the \"outputFlat\" flag is set, and for the Swift generator, this specifies a\n      file or directory (absolute or relative to the current working directory) to which:\n         - a file will be written for each query (if \"output\" is a directory)\n         - all generated types will be written\n      - For all other types, this defines a file (absolute or relative to the current working directory) to which all\n      generated types are written.\n\nOPTIONS\n  -c, --config=config                        Path to your Apollo config file\n  -t, --tag=tag                              The published service tag for this client\n\n  --[no-]addTypename                         [default: true] Automatically add __typename to your queries, can be unset\n                                             with --no-addTypename\n\n  --clientName=clientName                    Name of the client that the queries will be attached to\n\n  --clientReferenceId=clientReferenceId      Reference id for the client which will match ids from client traces, will\n                                             use clientName if not provided\n\n  --clientVersion=clientVersion              The version of the client that the queries will be attached to\n\n  --customScalarsPrefix=customScalarsPrefix  Include a prefix when using provided types for custom scalars\n\n  --endpoint=endpoint                        The url of your service\n\n  --excludes=excludes                        Glob of files to exclude for GraphQL operations. Caveat: this doesn't\n                                             currently work in watch mode\n\n  --globalTypesFile=globalTypesFile          By default, TypeScript will put a file named \"globalTypes.ts\" inside the\n                                             \"output\" directory. Set \"globalTypesFile\" to specify a different path.\n                                             Alternatively, set \"fileExtension\" to modify the extension of the file, for\n                                             example \"d.ts\" will output \"globalTypes.d.ts\"\n\n  --header=header                            Additional header to send to server for introspectionQuery. May be used\n                                             multiple times to add multiple headers. NOTE: The `--endpoint` flag is\n                                             REQUIRED if using the `--header` flag.\n\n  --includes=includes                        Glob of files to search for GraphQL operations. This should be used to find\n                                             queries *and* any client schema extensions\n\n  --key=key                                  The API key for the Apollo Engine service\n\n  --localSchemaFile=localSchemaFile          Path to your local GraphQL schema file (introspection result or SDL)\n\n  --mergeInFieldsFromFragmentSpreads         Merge fragment fields onto its enclosing type\n\n  --namespace=namespace                      The namespace to emit generated code into.\n\n  --only=only                                Parse all input files, but only output generated code for the specified\n                                             file [Swift only]\n\n  --operationIdsPath=operationIdsPath        Path to an operation id JSON map file. If specified, also stores the\n                                             operation ids (hashes) as properties on operation types [currently\n                                             Swift-only]\n\n  --outputFlat                               By default, TypeScript/Flow will put each generated file in a directory\n                                             next to its source file using the value of the \"output\" as the directory\n                                             name. Set \"outputFlat\" to put all generated files in the directory relative\n                                             to the current working directory defined by \"output\".\n\n  --passthroughCustomScalars                 Use your own types for custom scalars\n\n  --queries=queries                          Deprecated in favor of the includes flag\n\n  --tagName=tagName                          Name of the template literal tag used to identify template literals\n                                             containing GraphQL queries in Javascript/Typescript code\n\n  --target=target                            (required) Type of code generator to use (swift | typescript | flow |\n                                             scala)\n\n  --tsFileExtension=tsFileExtension          By default, TypeScript will output \"ts\" files. Set \"tsFileExtension\" to\n                                             specify a different file extension, for example \"d.ts\"\n\n  --useFlowExactObjects                      Use Flow exact objects for generated types [flow only]\n\n  --useFlowReadOnlyTypes                     Use read only types for generated types [flow only]. **Deprecated in favor\n                                             of `useReadOnlyTypes`.**\n\n  --useReadOnlyTypes                         Use read only types for generated types [flow | typescript]\n\n  --watch                                    Watch for file changes and reload codegen\n\nALIASES\n  $ apollo codegen:generate\n```\n\n_See code: [src/commands/client/codegen.ts](https://github.com/apollographql/apollo-tooling/blob/master/packages/apollo/src/commands/client/codegen.ts)_\n\n## `apollo client:download-schema OUTPUT`\n\nDownload a schema from engine or a GraphQL endpoint.\n\n```\nUSAGE\n  $ apollo client:download-schema OUTPUT\n\nARGUMENTS\n  OUTPUT  [default: schema.json] Path to write the introspection result to\n\nOPTIONS\n  -c, --config=config                    Path to your Apollo config file\n  -t, --tag=tag                          The published service tag for this client\n  --clientName=clientName                Name of the client that the queries will be attached to\n\n  --clientReferenceId=clientReferenceId  Reference id for the client which will match ids from client traces, will use\n                                         clientName if not provided\n\n  --clientVersion=clientVersion          The version of the client that the queries will be attached to\n\n  --endpoint=endpoint                    The url of your service\n\n  --excludes=excludes                    Glob of files to exclude for GraphQL operations. Caveat: this doesn't currently\n                                         work in watch mode\n\n  --header=header                        Additional header to send to server for introspectionQuery. May be used\n                                         multiple times to add multiple headers. NOTE: The `--endpoint` flag is REQUIRED\n                                         if using the `--header` flag.\n\n  --includes=includes                    Glob of files to search for GraphQL operations. This should be used to find\n                                         queries *and* any client schema extensions\n\n  --key=key                              The API key for the Apollo Engine service\n\n  --queries=queries                      Deprecated in favor of the includes flag\n\n  --tagName=tagName                      Name of the template literal tag used to identify template literals containing\n                                         GraphQL queries in Javascript/Typescript code\n```\n\n_See code: [src/commands/client/download-schema.ts](https://github.com/apollographql/apollo-tooling/blob/master/packages/apollo/src/commands/client/download-schema.ts)_\n\n## `apollo client:extract OUTPUT`\n\nExtract queries from a client\n\n```\nUSAGE\n  $ apollo client:extract OUTPUT\n\nARGUMENTS\n  OUTPUT  [default: manifest.json] Path to write the extracted queries to\n\nOPTIONS\n  -c, --config=config                    Path to your Apollo config file\n  -t, --tag=tag                          The published service tag for this client\n  --clientName=clientName                Name of the client that the queries will be attached to\n\n  --clientReferenceId=clientReferenceId  Reference id for the client which will match ids from client traces, will use\n                                         clientName if not provided\n\n  --clientVersion=clientVersion          The version of the client that the queries will be attached to\n\n  --endpoint=endpoint                    The url of your service\n\n  --excludes=excludes                    Glob of files to exclude for GraphQL operations. Caveat: this doesn't currently\n                                         work in watch mode\n\n  --header=header                        Additional header to send to server for introspectionQuery. May be used\n                                         multiple times to add multiple headers. NOTE: The `--endpoint` flag is REQUIRED\n                                         if using the `--header` flag.\n\n  --includes=includes                    Glob of files to search for GraphQL operations. This should be used to find\n                                         queries *and* any client schema extensions\n\n  --key=key                              The API key for the Apollo Engine service\n\n  --queries=queries                      Deprecated in favor of the includes flag\n\n  --tagName=tagName                      Name of the template literal tag used to identify template literals containing\n                                         GraphQL queries in Javascript/Typescript code\n```\n\n_See code: [src/commands/client/extract.ts](https://github.com/apollographql/apollo-tooling/blob/master/packages/apollo/src/commands/client/extract.ts)_\n\n## `apollo client:push`\n\nRegister operations with Apollo, adding them to the safelist\n\n```\nUSAGE\n  $ apollo client:push\n\nOPTIONS\n  -c, --config=config                    Path to your Apollo config file\n  -t, --tag=tag                          The published service tag for this client\n  --clientName=clientName                Name of the client that the queries will be attached to\n\n  --clientReferenceId=clientReferenceId  Reference id for the client which will match ids from client traces, will use\n                                         clientName if not provided\n\n  --clientVersion=clientVersion          The version of the client that the queries will be attached to\n\n  --endpoint=endpoint                    The url of your service\n\n  --excludes=excludes                    Glob of files to exclude for GraphQL operations. Caveat: this doesn't currently\n                                         work in watch mode\n\n  --header=header                        Additional header to send to server for introspectionQuery. May be used\n                                         multiple times to add multiple headers. NOTE: The `--endpoint` flag is REQUIRED\n                                         if using the `--header` flag.\n\n  --includes=includes                    Glob of files to search for GraphQL operations. This should be used to find\n                                         queries *and* any client schema extensions\n\n  --key=key                              The API key for the Apollo Engine service\n\n  --queries=queries                      Deprecated in favor of the includes flag\n\n  --tagName=tagName                      Name of the template literal tag used to identify template literals containing\n                                         GraphQL queries in Javascript/Typescript code\n```\n\n_See code: [src/commands/client/push.ts](https://github.com/apollographql/apollo-tooling/blob/master/packages/apollo/src/commands/client/push.ts)_\n\n## `apollo help [COMMAND]`\n\ndisplay help for apollo\n\n```\nUSAGE\n  $ apollo help [COMMAND]\n\nARGUMENTS\n  COMMAND  command to show help for\n\nOPTIONS\n  --all  see all commands in CLI\n```\n\n_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v2.2.1/src/commands/help.ts)_\n\n## `apollo plugins`\n\nlist installed plugins\n\n```\nUSAGE\n  $ apollo plugins\n\nOPTIONS\n  --core  show core plugins\n\nEXAMPLE\n  $ apollo plugins\n```\n\n_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v1.7.8/src/commands/plugins/index.ts)_\n\n## `apollo plugins:install PLUGIN...`\n\ninstalls a plugin into the CLI\n\n```\nUSAGE\n  $ apollo plugins:install PLUGIN...\n\nARGUMENTS\n  PLUGIN  plugin to install\n\nOPTIONS\n  -f, --force    yarn install with force flag\n  -h, --help     show CLI help\n  -v, --verbose\n\nDESCRIPTION\n  Can be installed from npm or a git url.\n\n  Installation of a user-installed plugin will override a core plugin.\n\n  e.g. If you have a core plugin that has a 'hello' command, installing a user-installed plugin with a 'hello' command\n  will override the core plugin implementation. This is useful if a user needs to update core plugin functionality in\n  the CLI without the need to patch and update the whole CLI.\n\nALIASES\n  $ apollo plugins:add\n\nEXAMPLES\n  $ apollo plugins:install myplugin\n  $ apollo plugins:install https://github.com/someuser/someplugin\n  $ apollo plugins:install someuser/someplugin\n```\n\n_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v1.7.8/src/commands/plugins/install.ts)_\n\n## `apollo plugins:link PLUGIN`\n\nlinks a plugin into the CLI for development\n\n```\nUSAGE\n  $ apollo plugins:link PLUGIN\n\nARGUMENTS\n  PATH  [default: .] path to plugin\n\nOPTIONS\n  -h, --help     show CLI help\n  -v, --verbose\n\nDESCRIPTION\n  Installation of a linked plugin will override a user-installed or core plugin.\n\n  e.g. If you have a user-installed or core plugin that has a 'hello' command, installing a linked plugin with a 'hello'\n  command will override the user-installed or core plugin implementation. This is useful for development work.\n\nEXAMPLE\n  $ apollo plugins:link myplugin\n```\n\n_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v1.7.8/src/commands/plugins/link.ts)_\n\n## `apollo plugins:uninstall PLUGIN...`\n\nremoves a plugin from the CLI\n\n```\nUSAGE\n  $ apollo plugins:uninstall PLUGIN...\n\nARGUMENTS\n  PLUGIN  plugin to uninstall\n\nOPTIONS\n  -h, --help     show CLI help\n  -v, --verbose\n\nALIASES\n  $ apollo plugins:unlink\n  $ apollo plugins:remove\n```\n\n_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v1.7.8/src/commands/plugins/uninstall.ts)_\n\n## `apollo plugins:update`\n\nupdate installed plugins\n\n```\nUSAGE\n  $ apollo plugins:update\n\nOPTIONS\n  -h, --help     show CLI help\n  -v, --verbose\n```\n\n_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v1.7.8/src/commands/plugins/update.ts)_\n\n## `apollo service:check`\n\nCheck a service against known operation workloads to find breaking changes\n\n```\nUSAGE\n  $ apollo service:check\n\nOPTIONS\n  -c, --config=config                                            Path to your Apollo config file\n  -t, --tag=tag                                                  The published tag to check this service against\n  --endpoint=endpoint                                            The url of your service\n\n  --header=header                                                Additional header to send to server for\n                                                                 introspectionQuery. May be used multiple times to add\n                                                                 multiple headers. NOTE: The `--endpoint` flag is\n                                                                 REQUIRED if using the `--header` flag.\n\n  --json                                                         Output result in json, which can then be parsed by CLI\n                                                                 tools such as jq.\n\n  --key=key                                                      The API key for the Apollo Engine service\n\n  --localSchemaFile=localSchemaFile                              Path to your local GraphQL schema file (introspection\n                                                                 result or SDL)\n\n  --markdown                                                     Output result in markdown.\n\n  --queryCountThreshold=queryCountThreshold                      Minimum number of requests within the requested time\n                                                                 window for a query to be considered.\n\n  --queryCountThresholdPercentage=queryCountThresholdPercentage  Number of requests within the requested time window for\n                                                                 a query to be considered, relative to total request\n                                                                 count. Expected values are between 0 and 0.05 (minimum\n                                                                 5% of total request volume)\n\n  --serviceName=serviceName                                      Provides the name of the implementing service for a\n                                                                 federated graph. This flag will indicate that the\n                                                                 schema is a partial schema from a federated service\n\n  --validationPeriod=validationPeriod                            The size of the time window with which to validate the\n                                                                 schema against. You may provide a number (in seconds),\n                                                                 or an ISO8601 format duration for more granularity\n                                                                 (see: https://en.wikipedia.org/wiki/ISO_8601#Durations)\n\nALIASES\n  $ apollo schema:check\n```\n\n_See code: [src/commands/service/check.ts](https://github.com/apollographql/apollo-tooling/blob/master/packages/apollo/src/commands/service/check.ts)_\n\n## `apollo service:delete`\n\nDelete a federated service from Engine and recompose remaining services\n\n```\nUSAGE\n  $ apollo service:delete\n\nOPTIONS\n  -c, --config=config        Path to your Apollo config file\n  -t, --tag=tag              The variant of the service to delete\n  --endpoint=endpoint        The url of your service\n\n  --header=header            Additional header to send to server for introspectionQuery. May be used multiple times to\n                             add multiple headers. NOTE: The `--endpoint` flag is REQUIRED if using the `--header` flag.\n\n  --key=key                  The API key for the Apollo Engine service\n\n  --serviceName=serviceName  (required) Provides the name of the implementing service for a federated graph\n```\n\n_See code: [src/commands/service/delete.ts](https://github.com/apollographql/apollo-tooling/blob/master/packages/apollo/src/commands/service/delete.ts)_\n\n## `apollo service:download OUTPUT`\n\nDownload the schema from your GraphQL endpoint.\n\n```\nUSAGE\n  $ apollo service:download OUTPUT\n\nARGUMENTS\n  OUTPUT  [default: schema.json] Path to write the introspection result to\n\nOPTIONS\n  -c, --config=config      Path to your Apollo config file\n  -k, --skipSSLValidation  Allow connections to an SSL site without certs\n  -t, --tag=tag            [default: current] The published tag to check this service against\n  --endpoint=endpoint      The url of your service\n\n  --header=header          Additional header to send to server for introspectionQuery. May be used multiple times to add\n                           multiple headers. NOTE: The `--endpoint` flag is REQUIRED if using the `--header` flag.\n\n  --key=key                The API key for the Apollo Engine service\n\nALIASES\n  $ apollo schema:download\n```\n\n_See code: [src/commands/service/download.ts](https://github.com/apollographql/apollo-tooling/blob/master/packages/apollo/src/commands/service/download.ts)_\n\n## `apollo service:list`\n\nList the services in a graph\n\n```\nUSAGE\n  $ apollo service:list\n\nOPTIONS\n  -c, --config=config  Path to your Apollo config file\n  -t, --tag=tag        The published tag to list the services from\n  --endpoint=endpoint  The url of your service\n\n  --header=header      Additional header to send to server for introspectionQuery. May be used multiple times to add\n                       multiple headers. NOTE: The `--endpoint` flag is REQUIRED if using the `--header` flag.\n\n  --key=key            The API key for the Apollo Engine service\n```\n\n_See code: [src/commands/service/list.ts](https://github.com/apollographql/apollo-tooling/blob/master/packages/apollo/src/commands/service/list.ts)_\n\n## `apollo service:push`\n\nPush a service to Engine\n\n```\nUSAGE\n  $ apollo service:push\n\nOPTIONS\n  -c, --config=config                Path to your Apollo config file\n  -t, --tag=tag                      [default: current] The tag to publish this service to\n  --endpoint=endpoint                The url of your service\n\n  --header=header                    Additional header to send to server for introspectionQuery. May be used multiple\n                                     times to add multiple headers. NOTE: The `--endpoint` flag is REQUIRED if using the\n                                     `--header` flag.\n\n  --key=key                          The API key for the Apollo Engine service\n\n  --localSchemaFile=localSchemaFile  Path to your local GraphQL schema file (introspection result or SDL)\n\n  --serviceName=serviceName          Provides the name of the implementing service for a federated graph\n\n  --serviceRevision=serviceRevision  Provides a unique revision identifier for a change to an implementing service on a\n                                     federated service push. The default of this is a git sha\n\n  --serviceURL=serviceURL            Provides the url to the location of the implementing service for a federated graph\n\nALIASES\n  $ apollo schema:publish\n```\n\n_See code: [src/commands/service/push.ts](https://github.com/apollographql/apollo-tooling/blob/master/packages/apollo/src/commands/service/push.ts)_\n\n\u003c!-- commandsstop --\u003e\n\n# Configuration\n\nThe Apollo CLI and VS Code extension can be configured with an Apollo config file. Apollo configuration is stored as a plain object in an `apollo.config.js` file which exports the configuration. For more information about configuring an Apollo project, see: https://bit.ly/2ByILPj.\n\n\u003e Note: the use of the `apollo` key in the project's package.json file for configuration is deprecated, and will no longer be supported in Apollo v3\n\nYou'll need to set up your Apollo configuration for all the features of the Apollo CLI and VS Code extension to work correctly. For full details on how to do that, [visit our docs](https://www.apollographql.com/docs/references/apollo-config.html). A basic configuration (`apollo.config.js` style) looks something like this:\n\n```js\nmodule.exports = {\n\tclient: {\n\t\tname: 'My Client Project',\n\t\tservice: 'my-service-name',\n\t},\n}\n```\n\n# Code Generation\n\n## Accompanying Libraries\n\nSee [Apollo iOS](https://github.com/apollographql/apollo-ios) for details on the mapping from GraphQL results to Swift types, as well as runtime support for executing queries and mutations. For Scala, see [React Apollo Scala.js](https://github.com/apollographql/react-apollo-scalajs) for details on how to use generated Scala code in a Scala.js app with Apollo Client.\n\n## `gql` template support\n\nIf the source file for generation is a JavaScript or TypeScript file, the codegen will try to extrapolate the queries inside the [gql tag](https://github.com/apollographql/graphql-tag) templates.\n\nThe tag name is configurable using the CLI `--tagName` option.\n\n## Typescript and Flow\n\nWhen using the codegen command with Typescript or Flow, make sure to add the `__typename` introspection field to every selection set within your graphql operations.\n\nIf you're using a client like `apollo-client` that does this automatically for your GraphQL operations, pass in the `--addTypename` option to `apollo codegen:generate` to make sure the generated Typescript and Flow types have the `__typename` field as well. This is required to ensure proper type generation support for `GraphQLUnionType` and `GraphQLInterfaceType` fields.\n\n## Why is the \\_\\_typename field required?\n\nUsing the type information from the GraphQL schema, we can infer the possible types for fields. However, in the case of a `GraphQLUnionType` or `GraphQLInterfaceType`, there are multiple types that are possible for that field. This is best modeled using a disjoint union with the `__typename`\nas the discriminant.\n\nFor example, given a schema:\n\n```graphql\n...\n\ninterface Character {\n  name: String!\n}\n\ntype Human implements Character {\n  homePlanet: String\n}\n\ntype Droid implements Character {\n  primaryFunction: String\n}\n\n...\n```\n\nWhenever a field of type `Character` is encountered, it could be either a Human or Droid. Human and Droid objects\nwill have a different set of fields. Within your application code, when interacting with a `Character` you'll want to make sure to handle both of these cases.\n\nGiven this query:\n\n```graphql\nquery Characters {\n\tcharacters(episode: NEW_HOPE) {\n\t\tname\n\n\t\t... on Human {\n\t\t\thomePlanet\n\t\t}\n\n\t\t... on Droid {\n\t\t\tprimaryFunction\n\t\t}\n\t}\n}\n```\n\nApollo Codegen will generate a union type for Character.\n\n```javascript\nexport type CharactersQuery = {\n\tcharacters: Array\u003c\n\t\t| {\n\t\t\t\t__typename: 'Human',\n\t\t\t\tname: string,\n\t\t\t\thomePlanet: ?string,\n\t\t  }\n\t\t| {\n\t\t\t\t__typename: 'Droid',\n\t\t\t\tname: string,\n\t\t\t\tprimaryFunction: ?string,\n\t\t  },\n\t\u003e,\n}\n```\n\nThis type can then be used as follows to ensure that all possible types are handled:\n\n```javascript\nfunction CharacterFigures({ characters }: CharactersQuery) {\n\treturn characters.map(character =\u003e {\n\t\tswitch (character.__typename) {\n\t\t\tcase 'Human':\n\t\t\t\treturn (\n\t\t\t\t\t\u003cHumanFigure\n\t\t\t\t\t\thomePlanet={character.homePlanet}\n\t\t\t\t\t\tname={character.name}\n\t\t\t\t\t/\u003e\n\t\t\t\t)\n\t\t\tcase 'Droid':\n\t\t\t\treturn (\n\t\t\t\t\t\u003cDroidFigure\n\t\t\t\t\t\tprimaryFunction={character.primaryFunction}\n\t\t\t\t\t\tname={character.name}\n\t\t\t\t\t/\u003e\n\t\t\t\t)\n\t\t}\n\t})\n}\n```\n\n# Contributing\n\n[![Build Status](https://circleci.com/gh/apollographql/apollo-tooling.svg?style=svg)](https://circleci.com/gh/apollographql/apollo-tooling)\n\nThis repo is composed of multiple packages managed by Lerna. The `apollo-cli` contains the core CLI commands. The `apollo-codegen-core` package contains all the compiler APIs needed to implement code generation support for new languages. The other `apollo-codegen-*` packages implement code generation support for individual languages.\n\nRunning tests locally:\n\n```\nnpm install\nnpm test\n```\n\nYou can also run `npm` commands within package folders after you have bootstrapped the repository (part of `npm install`).\n\n\u003e Note: if you have issues, try `npm run clean \u0026\u0026 npm i` to get a fresh install of the packages. Occasionally problems arise when removed dependencies stay around\n\n## Nock tests\n\nTo display the debugging messages for nock, run the following command:\n\n```bash\nDEBUG=nock.* npm test\n```\n\nIt can also be helpful to print standard out during testing. To enable logging, add the following configuration to the `stdout` function call during test creation:\n\n```\n.stdout({ print: true })\n```\n\n## Active Development / Debugging\n\nTo simplify the development process, you may want to step through and debug commands whose behavior you're modifying. To do this, run the executable with node in debug mode like so, where `\u003ccommand\u003e` is a valid CLI command like `client:check` or `service:push`:\n\n```\nnode --inspect-brk=9002 packages/apollo/bin/run \u003ccommand\u003e\n```\n\nIf you're using VS Code, you can run the included \"Attach to CLI Debugger\" launch task and debug right from VS Code! Otherwise, you may use the (Chrome inspector)[https://nodejs.org/en/docs/guides/debugging-getting-started/] or other Node debugger of your choice.\n\n## Regenerating Mocked Network Data\n\nSome integration tests rely on mocked server data (service:check for example). Mock data is generated by making real network requests and recording those requests with [`nock`'s recording feature](https://github.com/nock/nock#recording). Stop mocking network calls and add `nock.recorder.rec()` before network calls are made. For `service:check`, change `apiKey` to a real engine API key. Then run the tests and nock will output code to mock requests to the console. You can (and probably should) pare down the request to be less brittle (by only checking for an operation name, for example). See [`src/commands/service/__tests__/check.test.ts`](./packages/apollo/src/commands/service/__tests__/check.test.ts) for an example of how a mocked network request will look.\n\n## Publishing\n\n- Make sure the `CHANGELOG.md` is updated with all changes committed since the last release. Make sure the versions for each package to update are correct, and there's a blank `Upcoming` section for future work.\n- Run `npm run release` to publish the individual packages.\n\n## Maintainers\n\n- [@jbaxleyiii](https://github.com/jbaxleyiii) (Apollo)\n- [@trevor-scheer](https://github.com/trevor-scheer) (Apollo)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcerberus%2Fapollo-persisted-hash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcerberus%2Fapollo-persisted-hash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcerberus%2Fapollo-persisted-hash/lists"}