graphql-codegen Swift plugin for GraphQL operations.
You can find example project on /swift-test-project dir:
https://github.com/mtsmfm/graphql-codegen-swift-operations/tree/master/swift-test-project
Generated file:
Operations:
https://github.com/mtsmfm/graphql-codegen-swift-operations/tree/master/swift-test-project/graphql
Usage:
To install graphql-codegen, follow the
https://graphql-code-generator.com/docs/getting-started/installation
$ yarn add -D @mtsmfm/graphql-codegen-swift-operations
or
$ npm install --save-dev @mtsmfm/graphql-codegen-swift-operations
It'll be like the following:
schema: https://swapi.graph.cool/graphql
documents: 'query.graphql'
generates:
Sources/app/generated.swift:
- '@mtsmfm/graphql-codegen-swift-operations'
$ graphql-codegen
- InlineFragment
- Union
- Variables
- Customizable scalar map