FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
cppgraphqlgen/include/ClientGenerator.h at main · gitmodimo/cppgraphqlgen · GitHub
gitmodimo
/
cppgraphqlgen
Public
forked from
microsoft/cppgraphqlgen
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
cppgraphqlgen
/
include
/
ClientGenerator.h
Copy path
More file actions
More file actions
Latest commit
History
History
History
74 lines (60 loc) · 2.58 KB
Breadcrumbs
cppgraphqlgen
/
include
/
ClientGenerator.h
Copy path
File metadata and controls
74 lines (60 loc) · 2.58 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
//
Copyright (c) Microsoft Corporation. All rights reserved.
//
Licensed under the MIT License.
#
pragma
once
#
ifndef
CLIENTGENERATOR_H
#
define
CLIENTGENERATOR_H
#
include
"
RequestLoader.h
"
#
include
"
SchemaLoader.h
"
namespace
graphql
::generator::client {
struct
[[nodiscard]]
GeneratorPaths
{
const
std::string headerPath;
const
std::string sourcePath;
};
struct
[[nodiscard]]
GeneratorOptions
{
const
GeneratorPaths paths;
const
bool
verbose =
false
;
};
class
[[nodiscard]]
Generator
{
public:
//
Initialize the generator with the introspection client or a custom GraphQL client.
explicit
Generator
(
SchemaOptions&& schemaOptions, RequestOptions&& requestOptions, GeneratorOptions&& options);
//
Run the generator and return a list of filenames that were output.
[[nodiscard]]
std::vector<std::string>
Build
()
const
noexcept
;
private:
[[nodiscard]]
std::string
getHeaderDir
()
const
noexcept
;
[[nodiscard]]
std::string
getSourceDir
()
const
noexcept
;
[[nodiscard]]
std::string
getHeaderPath
()
const
noexcept
;
[[nodiscard]]
std::string
getSourcePath
()
const
noexcept
;
[[nodiscard]]
const
std::string&
getClientNamespace
()
const
noexcept
;
[[nodiscard]]
const
std::string&
getOperationNamespace
(
const
Operation& operation)
const
noexcept
;
[[nodiscard]]
std::string
getResponseFieldCppType
(
const
ResponseField& responseField, std::string_view currentScope = {})
const
noexcept
;
[[nodiscard]]
bool
outputHeader
()
const
noexcept
;
void
outputRequestComment
(std::ostream& headerFile)
const
noexcept
;
void
outputGetRequestDeclaration
(std::ostream& headerFile)
const
noexcept
;
void
outputGetOperationNameDeclaration
(std::ostream& headerFile)
const
noexcept
;
[[nodiscard]]
bool
outputResponseFieldType
(std::ostream& headerFile,
const
ResponseField& responseField,
size_t
indent =
0
)
const
noexcept
;
[[nodiscard]]
bool
outputSource
()
const
noexcept
;
void
outputGetRequestImplementation
(std::ostream& sourceFile)
const
noexcept
;
void
outputGetOperationNameImplementation
(
std::ostream& sourceFile,
const
Operation& operation)
const
noexcept
;
bool
outputModifiedResponseImplementation
(std::ostream& sourceFile,
const
std::string& outerScope,
const
ResponseField& responseField)
const
noexcept
;
[[nodiscard]]
static
std::string
getTypeModifierList
(
const
TypeModifierStack& modifiers)
noexcept
;
const
SchemaLoader _schemaLoader;
const
RequestLoader _requestLoader;
const
GeneratorOptions _options;
const
std::string _headerDir;
const
std::string _sourceDir;
const
std::string _headerPath;
const
std::string _sourcePath;
};
}
//
namespace graphql::generator::client
#
endif
//
CLIENTGENERATOR_H
Back
|
FazBrowse Home
|
New Git URL