Skip to content

Commit d0b14d1

Browse files
committed
Split cppgraphqlgen into separate client/server entries
1 parent 5728757 commit d0b14d1

File tree

3 files changed

+59
-15
lines changed

3 files changed

+59
-15
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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.

src/content/code/language-support/c-c/cppgraphqlgen.md

Lines changed: 0 additions & 15 deletions
This file was deleted.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
name: cppgraphqlgen-schemagen
3+
description: A C++20 GraphQL service generator using the schema document.
4+
url: https://github.com/microsoft/cppgraphqlgen
5+
github: microsoft/cppgraphqlgen
6+
---
7+
8+
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
9+
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:
10+
```
11+
Usage: schemagen [options] <schema 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+
-p [ --prefix ] arg Prefix to use for the generated C++ filenames
19+
-n [ --namespace ] arg C++ sub-namespace for the generated types
20+
--source-dir arg Target path for the <prefix>Schema.cpp source file
21+
--header-dir arg Target path for the <prefix>Schema.h header file
22+
--stubs Unimplemented fields throw runtime exceptions instead
23+
of compiler errors
24+
--no-introspection Do not generate support for Introspection
25+
```

0 commit comments

Comments
 (0)