FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
cppgraphqlgen/samples/proxy/query/ProxyClient.h at issues-334 · 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
/
samples
/
proxy
/
query
/
ProxyClient.h
Copy path
More file actions
More file actions
Latest commit
History
History
History
132 lines (98 loc) · 3.61 KB
Breadcrumbs
cppgraphqlgen
/
samples
/
proxy
/
query
/
ProxyClient.h
Copy path
File metadata and controls
132 lines (98 loc) · 3.61 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
//
Copyright (c) Microsoft Corporation. All rights reserved.
//
Licensed under the MIT License.
//
WARNING! Do not edit this file manually, your changes will be overwritten.
#
pragma
once
#
ifndef
PROXYCLIENT_H
#
define
PROXYCLIENT_H
#
include
"
graphqlservice/GraphQLClient.h
"
#
include
"
graphqlservice/GraphQLParse.h
"
#
include
"
graphqlservice/GraphQLResponse.h
"
#
include
"
graphqlservice/internal/Version.h
"
#
include
"
ProxySharedTypes.h
"
#
include
<
optional
>
#
include
<
string
>
#
include
<
vector
>
//
Check if the library version is compatible with clientgen 5.0.0
static_assert
(graphql::internal::MajorVersion ==
5
,
"
regenerate with clientgen: major version mismatch
"
);
static_assert
(graphql::internal::MinorVersion ==
0
,
"
regenerate with clientgen: minor version mismatch
"
);
namespace
graphql
::proxy {
//
/ # Operation: query relayQuery
//
/ ```graphql
//
/ # Copyright (c) Microsoft Corporation. All rights reserved.
//
/ # Licensed under the MIT License.
//
/
//
/ query relayQuery($input: QueryInput!) {
//
/ relay(input: $input) {
//
/ data
//
/ errors
//
/ }
//
/ }
//
/ ```
namespace
client
{
//
Return the original text of the request document.
[[nodiscard("unnecessary call")]]
const
std::string&
GetRequestText
()
noexcept
;
//
Return a pre-parsed, pre-validated request object.
[[nodiscard("unnecessary call")]]
const
peg::ast&
GetRequestObject
()
noexcept
;
namespace
query
::relayQuery {
using
graphql::proxy::client::GetRequestText;
using
graphql::proxy::client::GetRequestObject;
//
Return the name of this operation in the shared request document.
[[nodiscard("unnecessary call")]]
const
std::string&
GetOperationName
()
noexcept
;
using
graphql::proxy::OperationType;
using
graphql::proxy::QueryInput;
struct
[[nodiscard("unnecessary construction")]]
Variables
{
QueryInput input {};
};
[[nodiscard("unnecessary conversion")]]
response::Value
serializeVariables
(Variables&& variables);
struct
[[nodiscard("unnecessary construction")]]
Response
{
struct
[[nodiscard("unnecessary construction")]]
relay_QueryResults
{
std::optional<std::string> data {};
std::optional<std::vector<std::optional<std::string>>> errors {};
};
relay_QueryResults relay {};
};
class
ResponseVisitor
: public std::enable_shared_from_this<ResponseVisitor>
{
public:
ResponseVisitor
()
noexcept
;
~ResponseVisitor
();
void
add_value
(std::shared_ptr<
const
response::Value>&&);
void
reserve
(std::
size_t
count);
void
start_object
();
void
add_member
(std::string&& key);
void
end_object
();
void
start_array
();
void
end_array
();
void
add_null
();
void
add_string
(std::string&& value);
void
add_enum
(std::string&& value);
void
add_id
(response::IdType&& value);
void
add_bool
(
bool
value);
void
add_int
(
int
value);
void
add_float
(
double
value);
void
complete
();
Response
response
();
private:
struct
impl
;
std::unique_ptr<impl> _pimpl;
};
[[nodiscard("unnecessary conversion")]]
Response
parseResponse
(response::Value&& response);
struct
Traits
{
[[nodiscard("unnecessary call")]]
static
const
std::string&
GetRequestText
()
noexcept
;
[[nodiscard("unnecessary call")]]
static
const
peg::ast&
GetRequestObject
()
noexcept
;
[[nodiscard("unnecessary call")]]
static
const
std::string&
GetOperationName
()
noexcept
;
using
Variables = relayQuery::Variables;
[[nodiscard("unnecessary conversion")]]
static
response::Value
serializeVariables
(Variables&& variables);
using
Response = relayQuery::Response;
using
ResponseVisitor = relayQuery::ResponseVisitor;
[[nodiscard("unnecessary conversion")]]
static
Response
parseResponse
(response::Value&& response);
};
}
//
namespace query::relayQuery
}
//
namespace client
}
//
namespace graphql::proxy
#
endif
//
PROXYCLIENT_H
Back
|
FazBrowse Home
|
New Git URL