{"id":43790936,"url":"https://github.com/hyodotdev/openiap-gql","last_synced_at":"2026-02-05T20:17:54.672Z","repository":{"id":315063608,"uuid":"1057820094","full_name":"hyodotdev/openiap-gql","owner":"hyodotdev","description":"GraphQL definition of OpenIAP specification","archived":false,"fork":false,"pushed_at":"2025-10-16T08:21:38.000Z","size":2585,"stargazers_count":4,"open_issues_count":0,"forks_count":3,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-16T10:32:45.860Z","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/hyodotdev.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-16T08:49:53.000Z","updated_at":"2025-10-16T08:14:19.000Z","dependencies_parsed_at":"2025-09-16T14:38:30.146Z","dependency_job_id":"bfed6987-9a1a-42d0-87c5-e8252f17f27c","html_url":"https://github.com/hyodotdev/openiap-gql","commit_stats":null,"previous_names":["hyodotdev/openiap-graphql"],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/hyodotdev/openiap-gql","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyodotdev%2Fopeniap-gql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyodotdev%2Fopeniap-gql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyodotdev%2Fopeniap-gql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyodotdev%2Fopeniap-gql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hyodotdev","download_url":"https://codeload.github.com/hyodotdev/openiap-gql/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyodotdev%2Fopeniap-gql/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29133378,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-05T19:36:52.185Z","status":"ssl_error","status_checked_at":"2026-02-05T19:35:40.941Z","response_time":65,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":[],"created_at":"2026-02-05T20:17:53.856Z","updated_at":"2026-02-05T20:17:54.664Z","avatar_url":"https://github.com/hyodotdev.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# openiap-gql Code Generation Guide\n\n[![Generate Types](https://github.com/hyodotdev/openiap-gql/actions/workflows/generate-types.yml/badge.svg)](https://github.com/hyodotdev/openiap-gql/actions/workflows/generate-types.yml)\n\n\u003c!-- markdownlint-disable MD033 --\u003e\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/user-attachments/assets/f40873ee-dcf4-449e-93b2-203e6453da66\" alt=\"OpenIAP GraphQL logo\" width=\"320\" /\u003e\n  \u003cimg src=\"./logo.png\" alt=\"OpenIAP GraphQL logo\" width=\"320\" /\u003e\n  \u003cbr /\u003e\n  \u003cstrong\u003eOpenIAP meets GraphQL\u003c/strong\u003e\n\u003c/p\u003e\n\u003c!-- markdownlint-enable MD033 --\u003e\n\n_Unified schema and multiplatform codegen toolkit for OpenIAP._\n\nThis repository is the single source of truth for the OpenIAP GraphQL schema. The SDL\nfiles live in `src/` and are split into common (`type.graphql`, `api.graphql`), error\ntaxonomy (`error.graphql`), and platform-specific (`*-ios.graphql`, `*-android.graphql`)\ndefinitions.\n\nTo keep every consumer in sync, code generation helpers are provided for\nTypeScript, Dart, Swift, and Kotlin. Each section below explains the tooling,\ncommands, and output locations. Update the schema files first, then rerun the\nappropriate generator for your target language.\n\n---\n\n## TypeScript\n\nUses [`@graphql-codegen/cli`](https://www.the-guild.dev/graphql/codegen).\n\n1. Ensure Node 18+ is installed.\n2. Install dependencies once: `npm install`\n3. Generate types: `npm run generate`\n4. Generated output: `src/generated/types.ts`\n\nConfiguration lives in `codegen.ts`. The script merges every SDL file and\nemits a schema-first type layer that mirrors the documented shapes.\n\n---\n\n## Dart\n\nUses [`graphql_codegen`](https://pub.dev/packages/graphql_codegen) with\n`build_runner`. A ready-to-use package scaffold is located in\n`generators/dart/`.\n\n1. Install Dart 3.0+.\n2. `cd generators/dart`\n3. Fetch dependencies: `dart pub get`\n4. Add your `.graphql` operation documents under `lib/` or `graphql/`.\n5. Generate code: `dart run build_runner build`\n6. Generated output: `generators/dart/lib/generated/`\n\nThe `pubspec.yaml` and `build.yaml` already point the generator at the shared\nschema files in `../src`. Customize package name, output path, and scalars as\nneeded for your application.\n\n---\n\n## Swift\n\nRelies on the official [Apollo iOS CLI](https://www.apollographql.com/docs/ios/)\nfor schema codegen. A helper script is provided in `generators/swift/`.\n\n1. Install the CLI (one time): `brew install apollo-ios-cli`\n2. Run the helper: `generators/swift/generate-swift.sh`\n3. Generated output: `generators/swift/Generated/`\n\nThe script passes every SDL file to the CLI and emits an embedded module named\n`OpenIAPGraphQL`. Adjust the script flags to fit your Xcode project (e.g.\n`--module-type swiftPackage` or supply operation files via `--operation-paths`).\n\n---\n\n## Kotlin\n\nRecommended tooling is [Apollo Kotlin](https://www.apollographql.com/docs/kotlin).\nUse the Gradle plugin inside your Android project to consume the schema. Add a\ncodegen module (e.g. `:openiap-graphql`) and configure it as follows:\n\n```kotlin\nplugins {\n  id(\"com.apollographql.apollo3\") version \"4.0.0\"\n}\n\napollo {\n  service(\"openIap\") {\n    packageName.set(\"dev.openiap.graphql\")\n    schemaFiles.from(\n      file(\"../../src/type.graphql\"),\n      file(\"../../src/type-ios.graphql\"),\n      file(\"../../src/type-android.graphql\"),\n      file(\"../../src/api.graphql\"),\n      file(\"../../src/api-ios.graphql\"),\n      file(\"../../src/api-android.graphql\"),\n    )\n    // Point to your .graphql operations inside the module\n    srcDir(\"src/main/graphql\")\n  }\n}\n\ndependencies {\n  implementation(\"com.apollographql.apollo3:apollo-runtime:4.0.0\")\n}\n```\n\nThen run `./gradlew :openiap-graphql:generateApolloSources` to regenerate the\nmodels. Keep your query/mutation documents under `src/main/graphql` inside that\nmodule.\n\nIf you prefer to consume the pre-generated `src/generated/Types.kt` models from\nthis repo (via `npm run generate:kotlin`), add the JSON serialization runtime to\nyour Gradle module:\n\n```kotlin\ndependencies {\n  implementation(\"org.jetbrains.kotlinx:kotlinx-serialization-json:1.7.3\")\n}\n```\n\n---\n\n## Workflow Tips\n\n- Treat the SDL files in `src/` as the canonical schema. Commit schema updates\n  before shipping generated code.\n- Regenerate types whenever you change schema shape or add operations in your\n  client projects.\n- If you introduce custom scalars, make sure to extend the respective generator\n  config (TypeScript `codegen.ts`, Dart `build.yaml`, Kotlin Gradle config,\n  Swift `generate-swift.sh`) so they map to the desired native types.\n- Use version control to keep generated artifacts out of long-lived diffs unless\n  they are part of the published SDKs.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyodotdev%2Fopeniap-gql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhyodotdev%2Fopeniap-gql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyodotdev%2Fopeniap-gql/lists"}