{"id":26256447,"url":"https://github.com/netcracker/qubership-apihub-graphapi","last_synced_at":"2025-03-13T20:18:10.186Z","repository":{"id":270124051,"uuid":"907631303","full_name":"Netcracker/qubership-apihub-graphapi","owner":"Netcracker","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-13T19:08:30.000Z","size":3180,"stargazers_count":0,"open_issues_count":3,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-13T19:42:05.733Z","etag":null,"topics":["apihub"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Netcracker.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE-OF-CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-24T03:15:37.000Z","updated_at":"2025-02-16T18:37:24.000Z","dependencies_parsed_at":"2025-02-16T19:25:46.349Z","dependency_job_id":"bd158466-cc02-4890-b85c-1578ab3c72a2","html_url":"https://github.com/Netcracker/qubership-apihub-graphapi","commit_stats":null,"previous_names":["netcracker/qubership-apihub-graphapi"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Netcracker%2Fqubership-apihub-graphapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Netcracker%2Fqubership-apihub-graphapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Netcracker%2Fqubership-apihub-graphapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Netcracker%2Fqubership-apihub-graphapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Netcracker","download_url":"https://codeload.github.com/Netcracker/qubership-apihub-graphapi/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243475368,"owners_count":20296714,"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":["apihub"],"created_at":"2025-03-13T20:18:09.538Z","updated_at":"2025-03-13T20:18:10.170Z","avatar_url":"https://github.com/Netcracker.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# qubership-apihub-graphapi\n\nThis package provides utils to convert GraphQL schema into GraphAPI document and back.\u003cbr/\u003e\nThe GraphAPI Specification is GraphQL introspection alternative, but based on JsonSchema - OpenApi for GraphQL\n\n## Modifications\nModified version of [udamir/graphapi](https://github.com/udamir/graphapi)\n\n- Structure changed to better account for GraphQL specifics\n- Changed nullability handling \n- Field description/output description separation \n- Reduced number of unnatural diffs during later processing, caused by following OpenAPI structure\n\n## Features\n- JSON Schema-based representation of GraphQL document, similar to OpenAPI\n- Support custom directives in schema (meta) \n- GraphAPI document can be build from GraphQL Schema or Introspection\n- GraphAPI document can be converted to GraphQL Schema \n- Typescript syntax support out of the box\n- No dependencies, can be used in nodejs or browser\n\n## Installation\n```SH\nnpm install @netcracker/qubership-apihub-graphapi --save\n```\n\n## Usage\n\n### Build GraphAPI document from Schema or Introspection\n```ts\nimport { buildSchema, graphqlSync, getIntrospectionQuery } from \"graphql\"\nimport { buildFromSchema, buildFromIntrospection } from '@netcracker/qubership-apihub-graphapi'\n\n// build from GraphQL schema\nconst schema = buildSchema(data)\nconst graphapi1 = buildFromSchema(schema)\n\n// build from GraphQL introspection\nconst introspection = graphqlSync(data, getIntrospectionQuery()).data\nconst graphapi2 = buildFromIntrospection(introspection)\n\n```\n\n\u003e Important: only deprecated directives will be in result, as introspection not support custom directives meta\n\n### Print GraphQL schema document from GraphAPI document\n\n```ts\nimport { printGraphApi } from '@netcracker/qubership-apihub-graphapi'\n\nconst schema = printGraphApi(graphapi)\nconsole.log(schema)\n\n```\n\n## Contributing\nWhen contributing, keep in mind that it is an objective of `graphapi` to have no package dependencies. This may change in the future, but for now, no-dependencies.\n\nPlease run the unit tests before submitting your PR: `npm test`. Hopefully your PR includes additional unit tests to illustrate your change/modification!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetcracker%2Fqubership-apihub-graphapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnetcracker%2Fqubership-apihub-graphapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetcracker%2Fqubership-apihub-graphapi/lists"}