47#ifndef PROTOCORE_GRAPHQL_H
48#define PROTOCORE_GRAPHQL_H
52#if PROTOCORE_ENABLE_GRAPHQL
59 PROTOCORE_GQL_NULL = 0,
69 protocore_gql_type type;
77struct protocore_gql_args;
86typedef proto_bool (*protocore_gql_resolver_fn)(
const char *path,
const struct protocore_gql_args *args,
87 protocore_gql_value *out);
93 PROTOCORE_GQL_ERR_PARSE = -1,
94 PROTOCORE_GQL_ERR_LIMIT = -2,
95 PROTOCORE_GQL_ERR_OVERFLOW = -3
96} protocore_gql_result;
101 const char *document;
103 protocore_gql_resolver_fn resolver;
111} GraphQLResponseArgs;
116 const struct protocore_gql_args *values;
118} GraphQLArgumentArgs;
148 GraphQLRequestArgs request;
149 GraphQLResponseArgs response;
150 GraphQLArgumentArgs argument;
153 protocore_gql_result result;
160extern GraphQLVars GraphQLV;
165 void (*
const execute)(uint8_t *work);
166 void (*
const arg_int)(uint8_t *work);
167 void (*
const arg_str)(uint8_t *work);
168 void (*
const arg_bool)(uint8_t *work);
173void protocore_graph_ql_execute(uint8_t *work);
174void protocore_graph_ql_arg_int(uint8_t *work);
175void protocore_graph_ql_arg_str(uint8_t *work);
176void protocore_graph_ql_arg_bool(uint8_t *work);
182static const GraphQLNs GraphQL __attribute__((unused)) = {
183 .execute = protocore_graph_ql_execute,
184 .arg_int = protocore_graph_ql_arg_int,
185 .arg_str = protocore_graph_ql_arg_str,
186 .arg_bool = protocore_graph_ql_arg_bool,
198uint8_t *protocore_graphql_span(
void);
PROTO_ENUM_PACKED
Application protocol spoken on a listener port or connection slot.
#define PROTOCORE_BEGIN_DECLS
Give a header's declarations C linkage, so their symbol names carry no parameter types.
_Bool proto_bool
The truth value.
#define PROTOCORE_END_DECLS