-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split cppgraphqlgen into separate client/server entries
- Loading branch information
Showing
3 changed files
with
59 additions
and
15 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
src/content/code/language-support/c-c/client/cppgraphqlgen-clientgen.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
name: cppgraphqlgen-clientgen | ||
description: A C++20 GraphQL client request generator and response parser using the schema document. | ||
url: https://github.com/microsoft/cppgraphqlgen | ||
github: microsoft/cppgraphqlgen | ||
--- | ||
|
||
The `clientgen` utility is based on `schemagen` and shares the same external dependencies. The command line arguments | ||
are almost the same, except it takes an extra file for the request document and there is no equivalent to `--stubs`: | ||
``` | ||
Usage: clientgen [options] <schema file> <request file> <output filename prefix> <output namespace> | ||
Command line options: | ||
--version Print the version number | ||
-? [ --help ] Print the command line options | ||
-v [ --verbose ] Verbose output including generated header names as | ||
well as sources | ||
-s [ --schema ] arg Schema definition file path | ||
-r [ --request ] arg Request document file path | ||
-o [ --operation ] arg Operation name if the request document contains more | ||
than one | ||
-p [ --prefix ] arg Prefix to use for the generated C++ filenames | ||
-n [ --namespace ] arg C++ sub-namespace for the generated types | ||
--source-dir arg Target path for the <prefix>Client.cpp source file | ||
--header-dir arg Target path for the <prefix>Client.h header file | ||
--no-introspection Do not expect support for Introspection | ||
``` | ||
|
||
This utility should output one header and one source file for each request document. A request document may contain more | ||
than one operation, in which case it will output definitions for all of them together. You may limit the output to a | ||
single operation from the request document by specifying the `--operation` (or `-o`) argument with the operation name. | ||
|
||
The generated code depends on the `graphqlclient` library for serialization of built-in types. If you link the generated | ||
code, you'll also need to link `graphqlclient`, `graphqlpeg` for the pre-parsed, pre-validated request AST, and | ||
`graphqlresponse` for the `graphql::response::Value` implementation. |
This file was deleted.
Oops, something went wrong.
25 changes: 25 additions & 0 deletions
25
src/content/code/language-support/c-c/server/cppgraphqlgen-schemagen.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- | ||
name: cppgraphqlgen-schemagen | ||
description: A C++20 GraphQL service generator using the schema document. | ||
url: https://github.com/microsoft/cppgraphqlgen | ||
github: microsoft/cppgraphqlgen | ||
--- | ||
|
||
Run `schemagen -?` to get a list of options. Many of the files in the [samples](https://github.com/microsoft/cppgraphqlgen/tree/main/samples) directory were generated | ||
with `schemagen`, you can look at [samples/CMakeLists.txt](https://github.com/microsoft/cppgraphqlgen/blob/main/samples/CMakeLists.txt) for a few examples of how to call it: | ||
``` | ||
Usage: schemagen [options] <schema file> <output filename prefix> <output namespace> | ||
Command line options: | ||
--version Print the version number | ||
-? [ --help ] Print the command line options | ||
-v [ --verbose ] Verbose output including generated header names as | ||
well as sources | ||
-s [ --schema ] arg Schema definition file path | ||
-p [ --prefix ] arg Prefix to use for the generated C++ filenames | ||
-n [ --namespace ] arg C++ sub-namespace for the generated types | ||
--source-dir arg Target path for the <prefix>Schema.cpp source file | ||
--header-dir arg Target path for the <prefix>Schema.h header file | ||
--stubs Unimplemented fields throw runtime exceptions instead | ||
of compiler errors | ||
--no-introspection Do not generate support for Introspection | ||
``` |