|
| 1 | +--- |
| 2 | +name: cppgraphqlgen-clientgen |
| 3 | +description: A C++20 GraphQL client request generator and response parser using the schema document. |
| 4 | +url: https://github.com/microsoft/cppgraphqlgen |
| 5 | +github: microsoft/cppgraphqlgen |
| 6 | +--- |
| 7 | + |
| 8 | +The `clientgen` utility is based on `schemagen` and shares the same external dependencies. The command line arguments |
| 9 | +are almost the same, except it takes an extra file for the request document and there is no equivalent to `--stubs`: |
| 10 | +``` |
| 11 | +Usage: clientgen [options] <schema file> <request file> <output filename prefix> <output namespace> |
| 12 | +Command line options: |
| 13 | + --version Print the version number |
| 14 | + -? [ --help ] Print the command line options |
| 15 | + -v [ --verbose ] Verbose output including generated header names as |
| 16 | + well as sources |
| 17 | + -s [ --schema ] arg Schema definition file path |
| 18 | + -r [ --request ] arg Request document file path |
| 19 | + -o [ --operation ] arg Operation name if the request document contains more |
| 20 | + than one |
| 21 | + -p [ --prefix ] arg Prefix to use for the generated C++ filenames |
| 22 | + -n [ --namespace ] arg C++ sub-namespace for the generated types |
| 23 | + --source-dir arg Target path for the <prefix>Client.cpp source file |
| 24 | + --header-dir arg Target path for the <prefix>Client.h header file |
| 25 | + --no-introspection Do not expect support for Introspection |
| 26 | +``` |
| 27 | + |
| 28 | +This utility should output one header and one source file for each request document. A request document may contain more |
| 29 | +than one operation, in which case it will output definitions for all of them together. You may limit the output to a |
| 30 | +single operation from the request document by specifying the `--operation` (or `-o`) argument with the operation name. |
| 31 | + |
| 32 | +The generated code depends on the `graphqlclient` library for serialization of built-in types. If you link the generated |
| 33 | +code, you'll also need to link `graphqlclient`, `graphqlpeg` for the pre-parsed, pre-validated request AST, and |
| 34 | +`graphqlresponse` for the `graphql::response::Value` implementation. |
0 commit comments