rails-graphql 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.rdoc +19 -0
- data/Rakefile +31 -0
- data/ext/depend +3 -0
- data/ext/extconf.rb +57 -0
- data/ext/graphqlparser/Ast.cpp +346 -0
- data/ext/graphqlparser/Ast.h +1214 -0
- data/ext/graphqlparser/AstNode.h +36 -0
- data/ext/graphqlparser/AstVisitor.h +137 -0
- data/ext/graphqlparser/GraphQLParser.cpp +76 -0
- data/ext/graphqlparser/GraphQLParser.h +55 -0
- data/ext/graphqlparser/JsonVisitor.cpp +161 -0
- data/ext/graphqlparser/JsonVisitor.cpp.inc +456 -0
- data/ext/graphqlparser/JsonVisitor.h +121 -0
- data/ext/graphqlparser/JsonVisitor.h.inc +110 -0
- data/ext/graphqlparser/VERSION +1 -0
- data/ext/graphqlparser/c/GraphQLAst.cpp +324 -0
- data/ext/graphqlparser/c/GraphQLAst.h +180 -0
- data/ext/graphqlparser/c/GraphQLAstForEachConcreteType.h +44 -0
- data/ext/graphqlparser/c/GraphQLAstNode.cpp +25 -0
- data/ext/graphqlparser/c/GraphQLAstNode.h +33 -0
- data/ext/graphqlparser/c/GraphQLAstToJSON.cpp +21 -0
- data/ext/graphqlparser/c/GraphQLAstToJSON.h +24 -0
- data/ext/graphqlparser/c/GraphQLAstVisitor.cpp +55 -0
- data/ext/graphqlparser/c/GraphQLAstVisitor.h +53 -0
- data/ext/graphqlparser/c/GraphQLParser.cpp +35 -0
- data/ext/graphqlparser/c/GraphQLParser.h +54 -0
- data/ext/graphqlparser/dump_json_ast.cpp +48 -0
- data/ext/graphqlparser/lexer.lpp +324 -0
- data/ext/graphqlparser/parser.ypp +693 -0
- data/ext/graphqlparser/parsergen/lexer.cpp +2633 -0
- data/ext/graphqlparser/parsergen/lexer.h +528 -0
- data/ext/graphqlparser/parsergen/location.hh +189 -0
- data/ext/graphqlparser/parsergen/parser.tab.cpp +3300 -0
- data/ext/graphqlparser/parsergen/parser.tab.hpp +646 -0
- data/ext/graphqlparser/parsergen/position.hh +179 -0
- data/ext/graphqlparser/parsergen/stack.hh +156 -0
- data/ext/graphqlparser/syntaxdefs.h +19 -0
- data/ext/libgraphqlparser/AstNode.h +36 -0
- data/ext/libgraphqlparser/CMakeLists.txt +148 -0
- data/ext/libgraphqlparser/CONTRIBUTING.md +23 -0
- data/ext/libgraphqlparser/GraphQLParser.cpp +76 -0
- data/ext/libgraphqlparser/GraphQLParser.h +55 -0
- data/ext/libgraphqlparser/JsonVisitor.cpp +161 -0
- data/ext/libgraphqlparser/JsonVisitor.h +121 -0
- data/ext/libgraphqlparser/LICENSE +22 -0
- data/ext/libgraphqlparser/README.clang-tidy +7 -0
- data/ext/libgraphqlparser/README.md +84 -0
- data/ext/libgraphqlparser/ast/ast.ast +203 -0
- data/ext/libgraphqlparser/ast/ast.py +61 -0
- data/ext/libgraphqlparser/ast/c.py +100 -0
- data/ext/libgraphqlparser/ast/c.pyc +0 -0
- data/ext/libgraphqlparser/ast/c_impl.py +61 -0
- data/ext/libgraphqlparser/ast/c_impl.pyc +0 -0
- data/ext/libgraphqlparser/ast/c_visitor_impl.py +39 -0
- data/ext/libgraphqlparser/ast/c_visitor_impl.pyc +0 -0
- data/ext/libgraphqlparser/ast/casing.py +26 -0
- data/ext/libgraphqlparser/ast/casing.pyc +0 -0
- data/ext/libgraphqlparser/ast/cxx.py +197 -0
- data/ext/libgraphqlparser/ast/cxx.pyc +0 -0
- data/ext/libgraphqlparser/ast/cxx_impl.py +61 -0
- data/ext/libgraphqlparser/ast/cxx_impl.pyc +0 -0
- data/ext/libgraphqlparser/ast/cxx_json_visitor_header.py +42 -0
- data/ext/libgraphqlparser/ast/cxx_json_visitor_header.pyc +0 -0
- data/ext/libgraphqlparser/ast/cxx_json_visitor_impl.py +80 -0
- data/ext/libgraphqlparser/ast/cxx_json_visitor_impl.pyc +0 -0
- data/ext/libgraphqlparser/ast/cxx_visitor.py +64 -0
- data/ext/libgraphqlparser/ast/cxx_visitor.pyc +0 -0
- data/ext/libgraphqlparser/ast/js.py +65 -0
- data/ext/libgraphqlparser/ast/license.py +10 -0
- data/ext/libgraphqlparser/ast/license.pyc +0 -0
- data/ext/libgraphqlparser/c/GraphQLAstNode.cpp +25 -0
- data/ext/libgraphqlparser/c/GraphQLAstNode.h +33 -0
- data/ext/libgraphqlparser/c/GraphQLAstToJSON.cpp +21 -0
- data/ext/libgraphqlparser/c/GraphQLAstToJSON.h +24 -0
- data/ext/libgraphqlparser/c/GraphQLAstVisitor.cpp +55 -0
- data/ext/libgraphqlparser/c/GraphQLAstVisitor.h +53 -0
- data/ext/libgraphqlparser/c/GraphQLParser.cpp +35 -0
- data/ext/libgraphqlparser/c/GraphQLParser.h +54 -0
- data/ext/libgraphqlparser/clang-tidy-all.sh +3 -0
- data/ext/libgraphqlparser/cmake/version.cmake +16 -0
- data/ext/libgraphqlparser/dump_json_ast.cpp +48 -0
- data/ext/libgraphqlparser/go/README.md +20 -0
- data/ext/libgraphqlparser/go/callbacks.go +18 -0
- data/ext/libgraphqlparser/go/gotest.go +64 -0
- data/ext/libgraphqlparser/lexer.lpp +324 -0
- data/ext/libgraphqlparser/libgraphqlparser.pc.in +11 -0
- data/ext/libgraphqlparser/parser.ypp +693 -0
- data/ext/libgraphqlparser/parsergen/lexer.cpp +2633 -0
- data/ext/libgraphqlparser/parsergen/lexer.h +528 -0
- data/ext/libgraphqlparser/parsergen/location.hh +189 -0
- data/ext/libgraphqlparser/parsergen/parser.tab.cpp +3300 -0
- data/ext/libgraphqlparser/parsergen/parser.tab.hpp +646 -0
- data/ext/libgraphqlparser/parsergen/position.hh +179 -0
- data/ext/libgraphqlparser/parsergen/stack.hh +156 -0
- data/ext/libgraphqlparser/python/CMakeLists.txt +14 -0
- data/ext/libgraphqlparser/python/README.md +5 -0
- data/ext/libgraphqlparser/python/example.py +31 -0
- data/ext/libgraphqlparser/syntaxdefs.h +19 -0
- data/ext/libgraphqlparser/test/BuildCAPI.c +5 -0
- data/ext/libgraphqlparser/test/CMakeLists.txt +25 -0
- data/ext/libgraphqlparser/test/JsonVisitorTests.cpp +28 -0
- data/ext/libgraphqlparser/test/ParserTests.cpp +352 -0
- data/ext/libgraphqlparser/test/kitchen-sink.graphql +59 -0
- data/ext/libgraphqlparser/test/kitchen-sink.json +1 -0
- data/ext/libgraphqlparser/test/schema-kitchen-sink.graphql +78 -0
- data/ext/libgraphqlparser/test/schema-kitchen-sink.json +1 -0
- data/ext/libgraphqlparser/test/valgrind.supp +33 -0
- data/ext/version.cpp +21 -0
- data/lib/generators/graphql/controller_generator.rb +22 -0
- data/lib/generators/graphql/schema_generator.rb +22 -0
- data/lib/generators/graphql/templates/controller.erb +5 -0
- data/lib/generators/graphql/templates/schema.erb +6 -0
- data/lib/graphqlparser.so +0 -0
- data/lib/rails-graphql.rb +2 -0
- data/lib/rails/graphql.rake +1 -0
- data/lib/rails/graphql.rb +185 -0
- data/lib/rails/graphql/adapters/mysql_adapter.rb +0 -0
- data/lib/rails/graphql/adapters/pg_adapter.rb +50 -0
- data/lib/rails/graphql/adapters/sqlite_adapter.rb +39 -0
- data/lib/rails/graphql/argument.rb +220 -0
- data/lib/rails/graphql/callback.rb +124 -0
- data/lib/rails/graphql/collectors.rb +14 -0
- data/lib/rails/graphql/collectors/hash_collector.rb +83 -0
- data/lib/rails/graphql/collectors/idented_collector.rb +73 -0
- data/lib/rails/graphql/collectors/json_collector.rb +114 -0
- data/lib/rails/graphql/config.rb +61 -0
- data/lib/rails/graphql/directive.rb +203 -0
- data/lib/rails/graphql/directive/deprecated_directive.rb +59 -0
- data/lib/rails/graphql/directive/include_directive.rb +24 -0
- data/lib/rails/graphql/directive/skip_directive.rb +24 -0
- data/lib/rails/graphql/errors.rb +42 -0
- data/lib/rails/graphql/event.rb +141 -0
- data/lib/rails/graphql/field.rb +318 -0
- data/lib/rails/graphql/field/input_field.rb +92 -0
- data/lib/rails/graphql/field/mutation_field.rb +52 -0
- data/lib/rails/graphql/field/output_field.rb +96 -0
- data/lib/rails/graphql/field/proxied_field.rb +131 -0
- data/lib/rails/graphql/field/resolved_field.rb +96 -0
- data/lib/rails/graphql/field/scoped_config.rb +22 -0
- data/lib/rails/graphql/field/typed_field.rb +104 -0
- data/lib/rails/graphql/helpers.rb +40 -0
- data/lib/rails/graphql/helpers/attribute_delegator.rb +39 -0
- data/lib/rails/graphql/helpers/inherited_collection.rb +152 -0
- data/lib/rails/graphql/helpers/leaf_from_ar.rb +141 -0
- data/lib/rails/graphql/helpers/registerable.rb +103 -0
- data/lib/rails/graphql/helpers/with_arguments.rb +125 -0
- data/lib/rails/graphql/helpers/with_assignment.rb +113 -0
- data/lib/rails/graphql/helpers/with_callbacks.rb +55 -0
- data/lib/rails/graphql/helpers/with_directives.rb +126 -0
- data/lib/rails/graphql/helpers/with_events.rb +81 -0
- data/lib/rails/graphql/helpers/with_fields.rb +141 -0
- data/lib/rails/graphql/helpers/with_namespace.rb +40 -0
- data/lib/rails/graphql/helpers/with_owner.rb +35 -0
- data/lib/rails/graphql/helpers/with_schema_fields.rb +230 -0
- data/lib/rails/graphql/helpers/with_validator.rb +52 -0
- data/lib/rails/graphql/introspection.rb +53 -0
- data/lib/rails/graphql/native.rb +56 -0
- data/lib/rails/graphql/native/functions.rb +38 -0
- data/lib/rails/graphql/native/location.rb +41 -0
- data/lib/rails/graphql/native/pointers.rb +23 -0
- data/lib/rails/graphql/native/visitor.rb +349 -0
- data/lib/rails/graphql/railtie.rb +85 -0
- data/lib/rails/graphql/railties/base_generator.rb +35 -0
- data/lib/rails/graphql/railties/controller.rb +101 -0
- data/lib/rails/graphql/railties/controller_runtime.rb +40 -0
- data/lib/rails/graphql/railties/log_subscriber.rb +62 -0
- data/lib/rails/graphql/request.rb +343 -0
- data/lib/rails/graphql/request/arguments.rb +93 -0
- data/lib/rails/graphql/request/component.rb +100 -0
- data/lib/rails/graphql/request/component/field.rb +225 -0
- data/lib/rails/graphql/request/component/fragment.rb +118 -0
- data/lib/rails/graphql/request/component/operation.rb +178 -0
- data/lib/rails/graphql/request/component/operation/subscription.rb +16 -0
- data/lib/rails/graphql/request/component/spread.rb +119 -0
- data/lib/rails/graphql/request/component/typename.rb +82 -0
- data/lib/rails/graphql/request/context.rb +51 -0
- data/lib/rails/graphql/request/errors.rb +54 -0
- data/lib/rails/graphql/request/event.rb +112 -0
- data/lib/rails/graphql/request/helpers/directives.rb +64 -0
- data/lib/rails/graphql/request/helpers/selection_set.rb +87 -0
- data/lib/rails/graphql/request/helpers/value_writers.rb +115 -0
- data/lib/rails/graphql/request/steps/organizable.rb +146 -0
- data/lib/rails/graphql/request/steps/prepareable.rb +33 -0
- data/lib/rails/graphql/request/steps/resolveable.rb +32 -0
- data/lib/rails/graphql/request/strategy.rb +249 -0
- data/lib/rails/graphql/request/strategy/dynamic_instance.rb +41 -0
- data/lib/rails/graphql/request/strategy/multi_query_strategy.rb +36 -0
- data/lib/rails/graphql/request/strategy/sequenced_strategy.rb +28 -0
- data/lib/rails/graphql/schema.rb +272 -0
- data/lib/rails/graphql/shortcuts.rb +77 -0
- data/lib/rails/graphql/source.rb +371 -0
- data/lib/rails/graphql/source/active_record/builders.rb +154 -0
- data/lib/rails/graphql/source/active_record_source.rb +231 -0
- data/lib/rails/graphql/source/scoped_arguments.rb +87 -0
- data/lib/rails/graphql/to_gql.rb +368 -0
- data/lib/rails/graphql/type.rb +138 -0
- data/lib/rails/graphql/type/enum.rb +206 -0
- data/lib/rails/graphql/type/enum/directive_location_enum.rb +30 -0
- data/lib/rails/graphql/type/enum/type_kind_enum.rb +57 -0
- data/lib/rails/graphql/type/input.rb +134 -0
- data/lib/rails/graphql/type/interface.rb +82 -0
- data/lib/rails/graphql/type/object.rb +111 -0
- data/lib/rails/graphql/type/object/directive_object.rb +34 -0
- data/lib/rails/graphql/type/object/enum_value_object.rb +25 -0
- data/lib/rails/graphql/type/object/field_object.rb +54 -0
- data/lib/rails/graphql/type/object/input_value_object.rb +49 -0
- data/lib/rails/graphql/type/object/schema_object.rb +40 -0
- data/lib/rails/graphql/type/object/type_object.rb +136 -0
- data/lib/rails/graphql/type/scalar.rb +71 -0
- data/lib/rails/graphql/type/scalar/bigint_scalar.rb +34 -0
- data/lib/rails/graphql/type/scalar/binary_scalar.rb +30 -0
- data/lib/rails/graphql/type/scalar/boolean_scalar.rb +37 -0
- data/lib/rails/graphql/type/scalar/date_scalar.rb +34 -0
- data/lib/rails/graphql/type/scalar/date_time_scalar.rb +32 -0
- data/lib/rails/graphql/type/scalar/decimal_scalar.rb +35 -0
- data/lib/rails/graphql/type/scalar/float_scalar.rb +32 -0
- data/lib/rails/graphql/type/scalar/id_scalar.rb +39 -0
- data/lib/rails/graphql/type/scalar/int_scalar.rb +36 -0
- data/lib/rails/graphql/type/scalar/string_scalar.rb +28 -0
- data/lib/rails/graphql/type/scalar/time_scalar.rb +40 -0
- data/lib/rails/graphql/type/union.rb +87 -0
- data/lib/rails/graphql/type_map.rb +347 -0
- data/lib/rails/graphql/version.rb +7 -0
- data/test/assets/introspection-db.json +0 -0
- data/test/assets/introspection-mem.txt +1 -0
- data/test/assets/introspection.gql +91 -0
- data/test/assets/luke.jpg +0 -0
- data/test/assets/mem.gql +428 -0
- data/test/assets/sqlite.gql +423 -0
- data/test/config.rb +80 -0
- data/test/graphql/request/context_test.rb +70 -0
- data/test/graphql/schema_test.rb +190 -0
- data/test/graphql/source_test.rb +237 -0
- data/test/graphql/type/enum_test.rb +203 -0
- data/test/graphql/type/input_test.rb +138 -0
- data/test/graphql/type/interface_test.rb +72 -0
- data/test/graphql/type/object_test.rb +104 -0
- data/test/graphql/type/scalar/bigint_scalar_test.rb +42 -0
- data/test/graphql/type/scalar/binary_scalar_test.rb +17 -0
- data/test/graphql/type/scalar/boolean_scalar_test.rb +40 -0
- data/test/graphql/type/scalar/date_scalar_test.rb +29 -0
- data/test/graphql/type/scalar/date_time_scalar_test.rb +29 -0
- data/test/graphql/type/scalar/decimal_scalar_test.rb +28 -0
- data/test/graphql/type/scalar/float_scalar_test.rb +22 -0
- data/test/graphql/type/scalar/id_scalar_test.rb +26 -0
- data/test/graphql/type/scalar/int_scalar_test.rb +26 -0
- data/test/graphql/type/scalar/string_scalar_test.rb +17 -0
- data/test/graphql/type/scalar/time_scalar_test.rb +36 -0
- data/test/graphql/type/scalar_test.rb +45 -0
- data/test/graphql/type/union_test.rb +82 -0
- data/test/graphql/type_map_test.rb +362 -0
- data/test/graphql/type_test.rb +68 -0
- data/test/graphql_test.rb +55 -0
- data/test/integration/config.rb +56 -0
- data/test/integration/memory/star_wars_introspection_test.rb +144 -0
- data/test/integration/memory/star_wars_query_test.rb +184 -0
- data/test/integration/memory/star_wars_validation_test.rb +99 -0
- data/test/integration/schemas/memory.rb +232 -0
- data/test/integration/schemas/sqlite.rb +82 -0
- data/test/integration/sqlite/star_wars_introspection_test.rb +15 -0
- data/test/integration/sqlite/star_wars_mutation_test.rb +82 -0
- data/test/integration/sqlite/star_wars_query_test.rb +71 -0
- data/test/test_ext.rb +48 -0
- metadata +509 -0
@@ -0,0 +1,121 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright 2019-present, GraphQL Foundation
|
3
|
+
*
|
4
|
+
* This source code is licensed under the MIT license found in the
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
6
|
+
*/
|
7
|
+
|
8
|
+
#pragma once
|
9
|
+
|
10
|
+
#include "AstNode.h"
|
11
|
+
#include "AstVisitor.h"
|
12
|
+
|
13
|
+
#include <sstream>
|
14
|
+
#include <vector>
|
15
|
+
|
16
|
+
namespace facebook {
|
17
|
+
namespace graphql {
|
18
|
+
namespace ast {
|
19
|
+
namespace visitor {
|
20
|
+
|
21
|
+
/**
|
22
|
+
* Produces a JSON string describing the visited AST, in a format that
|
23
|
+
* would be a valid graphql-js AST when parsed.
|
24
|
+
*/
|
25
|
+
class JsonVisitor : public AstVisitor {
|
26
|
+
private:
|
27
|
+
using ChildrenList = std::vector<std::string>;
|
28
|
+
// Stack of lists of printed children.
|
29
|
+
// Postvisit method precondition: printed.back() contains strings
|
30
|
+
// for this node's children.
|
31
|
+
// Postvisit method postcondition: *(printed.rbegin() - 1) has had this
|
32
|
+
std::vector<ChildrenList> printed_;
|
33
|
+
|
34
|
+
// Interface to print fields for each kind of node.
|
35
|
+
// Note that, because of the post-order traversal for printing,
|
36
|
+
// field values need not be passed explicitly; they are grabbed from
|
37
|
+
// the passed-in visitor!
|
38
|
+
class NodeFieldPrinter {
|
39
|
+
private:
|
40
|
+
JsonVisitor &visitor_;
|
41
|
+
ChildrenList::const_iterator nextChild_;
|
42
|
+
std::ostringstream out_;
|
43
|
+
|
44
|
+
void printFieldSeparator();
|
45
|
+
|
46
|
+
// Prints a non-null array of n children from the given
|
47
|
+
// iterator. Does not update the iterator.
|
48
|
+
void printChildList(
|
49
|
+
std::ostringstream &out,
|
50
|
+
const std::vector<std::string>::const_iterator &childIterator,
|
51
|
+
size_t numChildren);
|
52
|
+
|
53
|
+
void printLocation(std::ostringstream &out, const yy::location &location);
|
54
|
+
|
55
|
+
public:
|
56
|
+
// Begin printing the fields for a node of the given kind at the
|
57
|
+
// given location.
|
58
|
+
NodeFieldPrinter(
|
59
|
+
JsonVisitor &visitor,
|
60
|
+
const char *nodeKind,
|
61
|
+
const Node &node);
|
62
|
+
|
63
|
+
std::string finishPrinting();
|
64
|
+
|
65
|
+
void printSingularPrimitiveField(const char *fieldName, const char *value);
|
66
|
+
void printSingularBooleanField(const char *fieldName, bool value);
|
67
|
+
void printSingularObjectField(const char *fieldName);
|
68
|
+
void printNullableSingularObjectField(const char *fieldName, const void *value);
|
69
|
+
|
70
|
+
template <typename T>
|
71
|
+
void printPluralField(
|
72
|
+
const char *fieldName,
|
73
|
+
const std::vector<std::unique_ptr<T>> &value) {
|
74
|
+
printFieldSeparator();
|
75
|
+
out_ << '"' << fieldName << "\":";
|
76
|
+
printChildList(out_, nextChild_, value.size());
|
77
|
+
nextChild_ += value.size();
|
78
|
+
}
|
79
|
+
|
80
|
+
template <typename T>
|
81
|
+
void printNullablePluralField(
|
82
|
+
const char *fieldName,
|
83
|
+
const std::vector<std::unique_ptr<T>> *value) {
|
84
|
+
printFieldSeparator();
|
85
|
+
out_ << '"' << fieldName << "\":";
|
86
|
+
if (value == nullptr) {
|
87
|
+
out_ << "null";
|
88
|
+
} else {
|
89
|
+
printChildList(out_, nextChild_, value->size());
|
90
|
+
nextChild_ += value->size();
|
91
|
+
}
|
92
|
+
}
|
93
|
+
};
|
94
|
+
|
95
|
+
// Must be called at the start of all visit methods for node types
|
96
|
+
// that have children. Maintains printed_.
|
97
|
+
void visitNode();
|
98
|
+
|
99
|
+
// Must be called at the end of all visit methods for node types
|
100
|
+
// that have children, passing the text for this node. Maintains
|
101
|
+
// printed_.
|
102
|
+
void endVisitNode(std::string &&str);
|
103
|
+
|
104
|
+
// Prints one of the many FooValue types that is prepresented with a
|
105
|
+
// single string.
|
106
|
+
template <typename ValueNode>
|
107
|
+
void endVisitValueRepresentedAsString(const char *valueKind, const ValueNode &value);
|
108
|
+
|
109
|
+
public:
|
110
|
+
JsonVisitor();
|
111
|
+
~JsonVisitor() {}
|
112
|
+
|
113
|
+
std::string getResult() const;
|
114
|
+
|
115
|
+
#include "JsonVisitor.h.inc"
|
116
|
+
};
|
117
|
+
|
118
|
+
}
|
119
|
+
}
|
120
|
+
}
|
121
|
+
}
|
@@ -0,0 +1,110 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright 2019-present GraphQL Foundation
|
3
|
+
* This source code is licensed under the MIT license found in the
|
4
|
+
* LICENSE file in the root directory of this source tree.
|
5
|
+
*/
|
6
|
+
/** @generated */
|
7
|
+
bool visitDocument(const Document &node) override;
|
8
|
+
void endVisitDocument(const Document &node) override;
|
9
|
+
|
10
|
+
bool visitOperationDefinition(const OperationDefinition &node) override;
|
11
|
+
void endVisitOperationDefinition(const OperationDefinition &node) override;
|
12
|
+
|
13
|
+
bool visitVariableDefinition(const VariableDefinition &node) override;
|
14
|
+
void endVisitVariableDefinition(const VariableDefinition &node) override;
|
15
|
+
|
16
|
+
bool visitSelectionSet(const SelectionSet &node) override;
|
17
|
+
void endVisitSelectionSet(const SelectionSet &node) override;
|
18
|
+
|
19
|
+
bool visitField(const Field &node) override;
|
20
|
+
void endVisitField(const Field &node) override;
|
21
|
+
|
22
|
+
bool visitArgument(const Argument &node) override;
|
23
|
+
void endVisitArgument(const Argument &node) override;
|
24
|
+
|
25
|
+
bool visitFragmentSpread(const FragmentSpread &node) override;
|
26
|
+
void endVisitFragmentSpread(const FragmentSpread &node) override;
|
27
|
+
|
28
|
+
bool visitInlineFragment(const InlineFragment &node) override;
|
29
|
+
void endVisitInlineFragment(const InlineFragment &node) override;
|
30
|
+
|
31
|
+
bool visitFragmentDefinition(const FragmentDefinition &node) override;
|
32
|
+
void endVisitFragmentDefinition(const FragmentDefinition &node) override;
|
33
|
+
|
34
|
+
bool visitVariable(const Variable &node) override;
|
35
|
+
void endVisitVariable(const Variable &node) override;
|
36
|
+
|
37
|
+
void endVisitIntValue(const IntValue &node) override;
|
38
|
+
|
39
|
+
void endVisitFloatValue(const FloatValue &node) override;
|
40
|
+
|
41
|
+
void endVisitStringValue(const StringValue &node) override;
|
42
|
+
|
43
|
+
void endVisitBooleanValue(const BooleanValue &node) override;
|
44
|
+
|
45
|
+
void endVisitNullValue(const NullValue &node) override;
|
46
|
+
|
47
|
+
void endVisitEnumValue(const EnumValue &node) override;
|
48
|
+
|
49
|
+
bool visitListValue(const ListValue &node) override;
|
50
|
+
void endVisitListValue(const ListValue &node) override;
|
51
|
+
|
52
|
+
bool visitObjectValue(const ObjectValue &node) override;
|
53
|
+
void endVisitObjectValue(const ObjectValue &node) override;
|
54
|
+
|
55
|
+
bool visitObjectField(const ObjectField &node) override;
|
56
|
+
void endVisitObjectField(const ObjectField &node) override;
|
57
|
+
|
58
|
+
bool visitDirective(const Directive &node) override;
|
59
|
+
void endVisitDirective(const Directive &node) override;
|
60
|
+
|
61
|
+
bool visitNamedType(const NamedType &node) override;
|
62
|
+
void endVisitNamedType(const NamedType &node) override;
|
63
|
+
|
64
|
+
bool visitListType(const ListType &node) override;
|
65
|
+
void endVisitListType(const ListType &node) override;
|
66
|
+
|
67
|
+
bool visitNonNullType(const NonNullType &node) override;
|
68
|
+
void endVisitNonNullType(const NonNullType &node) override;
|
69
|
+
|
70
|
+
void endVisitName(const Name &node) override;
|
71
|
+
|
72
|
+
bool visitSchemaDefinition(const SchemaDefinition &node) override;
|
73
|
+
void endVisitSchemaDefinition(const SchemaDefinition &node) override;
|
74
|
+
|
75
|
+
bool visitOperationTypeDefinition(const OperationTypeDefinition &node) override;
|
76
|
+
void endVisitOperationTypeDefinition(const OperationTypeDefinition &node) override;
|
77
|
+
|
78
|
+
bool visitScalarTypeDefinition(const ScalarTypeDefinition &node) override;
|
79
|
+
void endVisitScalarTypeDefinition(const ScalarTypeDefinition &node) override;
|
80
|
+
|
81
|
+
bool visitObjectTypeDefinition(const ObjectTypeDefinition &node) override;
|
82
|
+
void endVisitObjectTypeDefinition(const ObjectTypeDefinition &node) override;
|
83
|
+
|
84
|
+
bool visitFieldDefinition(const FieldDefinition &node) override;
|
85
|
+
void endVisitFieldDefinition(const FieldDefinition &node) override;
|
86
|
+
|
87
|
+
bool visitInputValueDefinition(const InputValueDefinition &node) override;
|
88
|
+
void endVisitInputValueDefinition(const InputValueDefinition &node) override;
|
89
|
+
|
90
|
+
bool visitInterfaceTypeDefinition(const InterfaceTypeDefinition &node) override;
|
91
|
+
void endVisitInterfaceTypeDefinition(const InterfaceTypeDefinition &node) override;
|
92
|
+
|
93
|
+
bool visitUnionTypeDefinition(const UnionTypeDefinition &node) override;
|
94
|
+
void endVisitUnionTypeDefinition(const UnionTypeDefinition &node) override;
|
95
|
+
|
96
|
+
bool visitEnumTypeDefinition(const EnumTypeDefinition &node) override;
|
97
|
+
void endVisitEnumTypeDefinition(const EnumTypeDefinition &node) override;
|
98
|
+
|
99
|
+
bool visitEnumValueDefinition(const EnumValueDefinition &node) override;
|
100
|
+
void endVisitEnumValueDefinition(const EnumValueDefinition &node) override;
|
101
|
+
|
102
|
+
bool visitInputObjectTypeDefinition(const InputObjectTypeDefinition &node) override;
|
103
|
+
void endVisitInputObjectTypeDefinition(const InputObjectTypeDefinition &node) override;
|
104
|
+
|
105
|
+
bool visitTypeExtensionDefinition(const TypeExtensionDefinition &node) override;
|
106
|
+
void endVisitTypeExtensionDefinition(const TypeExtensionDefinition &node) override;
|
107
|
+
|
108
|
+
bool visitDirectiveDefinition(const DirectiveDefinition &node) override;
|
109
|
+
void endVisitDirectiveDefinition(const DirectiveDefinition &node) override;
|
110
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
0.7.0
|
@@ -0,0 +1,324 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright 2019-present GraphQL Foundation
|
3
|
+
* This source code is licensed under the MIT license found in the
|
4
|
+
* LICENSE file in the root directory of this source tree.
|
5
|
+
*/
|
6
|
+
/** @generated */
|
7
|
+
|
8
|
+
#include "GraphQLAst.h"
|
9
|
+
#include "../Ast.h"
|
10
|
+
|
11
|
+
using namespace facebook::graphql::ast; // NOLINT
|
12
|
+
|
13
|
+
int GraphQLAstDocument_get_definitions_size(const struct GraphQLAstDocument *node) {
|
14
|
+
const auto *realNode = reinterpret_cast<const Document *>(node);
|
15
|
+
return realNode->getDefinitions().size();
|
16
|
+
}
|
17
|
+
const char * GraphQLAstOperationDefinition_get_operation(const struct GraphQLAstOperationDefinition *node) {
|
18
|
+
const auto *realNode = reinterpret_cast<const OperationDefinition *>(node);
|
19
|
+
return realNode->getOperation();
|
20
|
+
}
|
21
|
+
const struct GraphQLAstName * GraphQLAstOperationDefinition_get_name(const struct GraphQLAstOperationDefinition *node) {
|
22
|
+
const auto *realNode = reinterpret_cast<const OperationDefinition *>(node);
|
23
|
+
return reinterpret_cast<const struct GraphQLAstName *>(realNode->getName());
|
24
|
+
}
|
25
|
+
int GraphQLAstOperationDefinition_get_variable_definitions_size(const struct GraphQLAstOperationDefinition *node) {
|
26
|
+
const auto *realNode = reinterpret_cast<const OperationDefinition *>(node);
|
27
|
+
return realNode->getVariableDefinitions() ? realNode->getVariableDefinitions()->size() : 0;
|
28
|
+
}
|
29
|
+
int GraphQLAstOperationDefinition_get_directives_size(const struct GraphQLAstOperationDefinition *node) {
|
30
|
+
const auto *realNode = reinterpret_cast<const OperationDefinition *>(node);
|
31
|
+
return realNode->getDirectives() ? realNode->getDirectives()->size() : 0;
|
32
|
+
}
|
33
|
+
const struct GraphQLAstSelectionSet * GraphQLAstOperationDefinition_get_selection_set(const struct GraphQLAstOperationDefinition *node) {
|
34
|
+
const auto *realNode = reinterpret_cast<const OperationDefinition *>(node);
|
35
|
+
return reinterpret_cast<const struct GraphQLAstSelectionSet *>(&realNode->getSelectionSet());
|
36
|
+
}
|
37
|
+
const struct GraphQLAstVariable * GraphQLAstVariableDefinition_get_variable(const struct GraphQLAstVariableDefinition *node) {
|
38
|
+
const auto *realNode = reinterpret_cast<const VariableDefinition *>(node);
|
39
|
+
return reinterpret_cast<const struct GraphQLAstVariable *>(&realNode->getVariable());
|
40
|
+
}
|
41
|
+
const struct GraphQLAstType * GraphQLAstVariableDefinition_get_type(const struct GraphQLAstVariableDefinition *node) {
|
42
|
+
const auto *realNode = reinterpret_cast<const VariableDefinition *>(node);
|
43
|
+
return reinterpret_cast<const struct GraphQLAstType *>(&realNode->getType());
|
44
|
+
}
|
45
|
+
const struct GraphQLAstValue * GraphQLAstVariableDefinition_get_default_value(const struct GraphQLAstVariableDefinition *node) {
|
46
|
+
const auto *realNode = reinterpret_cast<const VariableDefinition *>(node);
|
47
|
+
return reinterpret_cast<const struct GraphQLAstValue *>(realNode->getDefaultValue());
|
48
|
+
}
|
49
|
+
int GraphQLAstSelectionSet_get_selections_size(const struct GraphQLAstSelectionSet *node) {
|
50
|
+
const auto *realNode = reinterpret_cast<const SelectionSet *>(node);
|
51
|
+
return realNode->getSelections().size();
|
52
|
+
}
|
53
|
+
const struct GraphQLAstName * GraphQLAstField_get_alias(const struct GraphQLAstField *node) {
|
54
|
+
const auto *realNode = reinterpret_cast<const Field *>(node);
|
55
|
+
return reinterpret_cast<const struct GraphQLAstName *>(realNode->getAlias());
|
56
|
+
}
|
57
|
+
const struct GraphQLAstName * GraphQLAstField_get_name(const struct GraphQLAstField *node) {
|
58
|
+
const auto *realNode = reinterpret_cast<const Field *>(node);
|
59
|
+
return reinterpret_cast<const struct GraphQLAstName *>(&realNode->getName());
|
60
|
+
}
|
61
|
+
int GraphQLAstField_get_arguments_size(const struct GraphQLAstField *node) {
|
62
|
+
const auto *realNode = reinterpret_cast<const Field *>(node);
|
63
|
+
return realNode->getArguments() ? realNode->getArguments()->size() : 0;
|
64
|
+
}
|
65
|
+
int GraphQLAstField_get_directives_size(const struct GraphQLAstField *node) {
|
66
|
+
const auto *realNode = reinterpret_cast<const Field *>(node);
|
67
|
+
return realNode->getDirectives() ? realNode->getDirectives()->size() : 0;
|
68
|
+
}
|
69
|
+
const struct GraphQLAstSelectionSet * GraphQLAstField_get_selection_set(const struct GraphQLAstField *node) {
|
70
|
+
const auto *realNode = reinterpret_cast<const Field *>(node);
|
71
|
+
return reinterpret_cast<const struct GraphQLAstSelectionSet *>(realNode->getSelectionSet());
|
72
|
+
}
|
73
|
+
const struct GraphQLAstName * GraphQLAstArgument_get_name(const struct GraphQLAstArgument *node) {
|
74
|
+
const auto *realNode = reinterpret_cast<const Argument *>(node);
|
75
|
+
return reinterpret_cast<const struct GraphQLAstName *>(&realNode->getName());
|
76
|
+
}
|
77
|
+
const struct GraphQLAstValue * GraphQLAstArgument_get_value(const struct GraphQLAstArgument *node) {
|
78
|
+
const auto *realNode = reinterpret_cast<const Argument *>(node);
|
79
|
+
return reinterpret_cast<const struct GraphQLAstValue *>(&realNode->getValue());
|
80
|
+
}
|
81
|
+
const struct GraphQLAstName * GraphQLAstFragmentSpread_get_name(const struct GraphQLAstFragmentSpread *node) {
|
82
|
+
const auto *realNode = reinterpret_cast<const FragmentSpread *>(node);
|
83
|
+
return reinterpret_cast<const struct GraphQLAstName *>(&realNode->getName());
|
84
|
+
}
|
85
|
+
int GraphQLAstFragmentSpread_get_directives_size(const struct GraphQLAstFragmentSpread *node) {
|
86
|
+
const auto *realNode = reinterpret_cast<const FragmentSpread *>(node);
|
87
|
+
return realNode->getDirectives() ? realNode->getDirectives()->size() : 0;
|
88
|
+
}
|
89
|
+
const struct GraphQLAstNamedType * GraphQLAstInlineFragment_get_type_condition(const struct GraphQLAstInlineFragment *node) {
|
90
|
+
const auto *realNode = reinterpret_cast<const InlineFragment *>(node);
|
91
|
+
return reinterpret_cast<const struct GraphQLAstNamedType *>(realNode->getTypeCondition());
|
92
|
+
}
|
93
|
+
int GraphQLAstInlineFragment_get_directives_size(const struct GraphQLAstInlineFragment *node) {
|
94
|
+
const auto *realNode = reinterpret_cast<const InlineFragment *>(node);
|
95
|
+
return realNode->getDirectives() ? realNode->getDirectives()->size() : 0;
|
96
|
+
}
|
97
|
+
const struct GraphQLAstSelectionSet * GraphQLAstInlineFragment_get_selection_set(const struct GraphQLAstInlineFragment *node) {
|
98
|
+
const auto *realNode = reinterpret_cast<const InlineFragment *>(node);
|
99
|
+
return reinterpret_cast<const struct GraphQLAstSelectionSet *>(&realNode->getSelectionSet());
|
100
|
+
}
|
101
|
+
const struct GraphQLAstName * GraphQLAstFragmentDefinition_get_name(const struct GraphQLAstFragmentDefinition *node) {
|
102
|
+
const auto *realNode = reinterpret_cast<const FragmentDefinition *>(node);
|
103
|
+
return reinterpret_cast<const struct GraphQLAstName *>(&realNode->getName());
|
104
|
+
}
|
105
|
+
const struct GraphQLAstNamedType * GraphQLAstFragmentDefinition_get_type_condition(const struct GraphQLAstFragmentDefinition *node) {
|
106
|
+
const auto *realNode = reinterpret_cast<const FragmentDefinition *>(node);
|
107
|
+
return reinterpret_cast<const struct GraphQLAstNamedType *>(&realNode->getTypeCondition());
|
108
|
+
}
|
109
|
+
int GraphQLAstFragmentDefinition_get_directives_size(const struct GraphQLAstFragmentDefinition *node) {
|
110
|
+
const auto *realNode = reinterpret_cast<const FragmentDefinition *>(node);
|
111
|
+
return realNode->getDirectives() ? realNode->getDirectives()->size() : 0;
|
112
|
+
}
|
113
|
+
const struct GraphQLAstSelectionSet * GraphQLAstFragmentDefinition_get_selection_set(const struct GraphQLAstFragmentDefinition *node) {
|
114
|
+
const auto *realNode = reinterpret_cast<const FragmentDefinition *>(node);
|
115
|
+
return reinterpret_cast<const struct GraphQLAstSelectionSet *>(&realNode->getSelectionSet());
|
116
|
+
}
|
117
|
+
const struct GraphQLAstName * GraphQLAstVariable_get_name(const struct GraphQLAstVariable *node) {
|
118
|
+
const auto *realNode = reinterpret_cast<const Variable *>(node);
|
119
|
+
return reinterpret_cast<const struct GraphQLAstName *>(&realNode->getName());
|
120
|
+
}
|
121
|
+
const char * GraphQLAstIntValue_get_value(const struct GraphQLAstIntValue *node) {
|
122
|
+
const auto *realNode = reinterpret_cast<const IntValue *>(node);
|
123
|
+
return realNode->getValue();
|
124
|
+
}
|
125
|
+
const char * GraphQLAstFloatValue_get_value(const struct GraphQLAstFloatValue *node) {
|
126
|
+
const auto *realNode = reinterpret_cast<const FloatValue *>(node);
|
127
|
+
return realNode->getValue();
|
128
|
+
}
|
129
|
+
const char * GraphQLAstStringValue_get_value(const struct GraphQLAstStringValue *node) {
|
130
|
+
const auto *realNode = reinterpret_cast<const StringValue *>(node);
|
131
|
+
return realNode->getValue();
|
132
|
+
}
|
133
|
+
int GraphQLAstBooleanValue_get_value(const struct GraphQLAstBooleanValue *node) {
|
134
|
+
const auto *realNode = reinterpret_cast<const BooleanValue *>(node);
|
135
|
+
return realNode->getValue();
|
136
|
+
}
|
137
|
+
const char * GraphQLAstEnumValue_get_value(const struct GraphQLAstEnumValue *node) {
|
138
|
+
const auto *realNode = reinterpret_cast<const EnumValue *>(node);
|
139
|
+
return realNode->getValue();
|
140
|
+
}
|
141
|
+
int GraphQLAstListValue_get_values_size(const struct GraphQLAstListValue *node) {
|
142
|
+
const auto *realNode = reinterpret_cast<const ListValue *>(node);
|
143
|
+
return realNode->getValues().size();
|
144
|
+
}
|
145
|
+
int GraphQLAstObjectValue_get_fields_size(const struct GraphQLAstObjectValue *node) {
|
146
|
+
const auto *realNode = reinterpret_cast<const ObjectValue *>(node);
|
147
|
+
return realNode->getFields().size();
|
148
|
+
}
|
149
|
+
const struct GraphQLAstName * GraphQLAstObjectField_get_name(const struct GraphQLAstObjectField *node) {
|
150
|
+
const auto *realNode = reinterpret_cast<const ObjectField *>(node);
|
151
|
+
return reinterpret_cast<const struct GraphQLAstName *>(&realNode->getName());
|
152
|
+
}
|
153
|
+
const struct GraphQLAstValue * GraphQLAstObjectField_get_value(const struct GraphQLAstObjectField *node) {
|
154
|
+
const auto *realNode = reinterpret_cast<const ObjectField *>(node);
|
155
|
+
return reinterpret_cast<const struct GraphQLAstValue *>(&realNode->getValue());
|
156
|
+
}
|
157
|
+
const struct GraphQLAstName * GraphQLAstDirective_get_name(const struct GraphQLAstDirective *node) {
|
158
|
+
const auto *realNode = reinterpret_cast<const Directive *>(node);
|
159
|
+
return reinterpret_cast<const struct GraphQLAstName *>(&realNode->getName());
|
160
|
+
}
|
161
|
+
int GraphQLAstDirective_get_arguments_size(const struct GraphQLAstDirective *node) {
|
162
|
+
const auto *realNode = reinterpret_cast<const Directive *>(node);
|
163
|
+
return realNode->getArguments() ? realNode->getArguments()->size() : 0;
|
164
|
+
}
|
165
|
+
const struct GraphQLAstName * GraphQLAstNamedType_get_name(const struct GraphQLAstNamedType *node) {
|
166
|
+
const auto *realNode = reinterpret_cast<const NamedType *>(node);
|
167
|
+
return reinterpret_cast<const struct GraphQLAstName *>(&realNode->getName());
|
168
|
+
}
|
169
|
+
const struct GraphQLAstType * GraphQLAstListType_get_type(const struct GraphQLAstListType *node) {
|
170
|
+
const auto *realNode = reinterpret_cast<const ListType *>(node);
|
171
|
+
return reinterpret_cast<const struct GraphQLAstType *>(&realNode->getType());
|
172
|
+
}
|
173
|
+
const struct GraphQLAstType * GraphQLAstNonNullType_get_type(const struct GraphQLAstNonNullType *node) {
|
174
|
+
const auto *realNode = reinterpret_cast<const NonNullType *>(node);
|
175
|
+
return reinterpret_cast<const struct GraphQLAstType *>(&realNode->getType());
|
176
|
+
}
|
177
|
+
const char * GraphQLAstName_get_value(const struct GraphQLAstName *node) {
|
178
|
+
const auto *realNode = reinterpret_cast<const Name *>(node);
|
179
|
+
return realNode->getValue();
|
180
|
+
}
|
181
|
+
int GraphQLAstSchemaDefinition_get_directives_size(const struct GraphQLAstSchemaDefinition *node) {
|
182
|
+
const auto *realNode = reinterpret_cast<const SchemaDefinition *>(node);
|
183
|
+
return realNode->getDirectives() ? realNode->getDirectives()->size() : 0;
|
184
|
+
}
|
185
|
+
int GraphQLAstSchemaDefinition_get_operation_types_size(const struct GraphQLAstSchemaDefinition *node) {
|
186
|
+
const auto *realNode = reinterpret_cast<const SchemaDefinition *>(node);
|
187
|
+
return realNode->getOperationTypes().size();
|
188
|
+
}
|
189
|
+
const char * GraphQLAstOperationTypeDefinition_get_operation(const struct GraphQLAstOperationTypeDefinition *node) {
|
190
|
+
const auto *realNode = reinterpret_cast<const OperationTypeDefinition *>(node);
|
191
|
+
return realNode->getOperation();
|
192
|
+
}
|
193
|
+
const struct GraphQLAstNamedType * GraphQLAstOperationTypeDefinition_get_type(const struct GraphQLAstOperationTypeDefinition *node) {
|
194
|
+
const auto *realNode = reinterpret_cast<const OperationTypeDefinition *>(node);
|
195
|
+
return reinterpret_cast<const struct GraphQLAstNamedType *>(&realNode->getType());
|
196
|
+
}
|
197
|
+
const struct GraphQLAstName * GraphQLAstScalarTypeDefinition_get_name(const struct GraphQLAstScalarTypeDefinition *node) {
|
198
|
+
const auto *realNode = reinterpret_cast<const ScalarTypeDefinition *>(node);
|
199
|
+
return reinterpret_cast<const struct GraphQLAstName *>(&realNode->getName());
|
200
|
+
}
|
201
|
+
int GraphQLAstScalarTypeDefinition_get_directives_size(const struct GraphQLAstScalarTypeDefinition *node) {
|
202
|
+
const auto *realNode = reinterpret_cast<const ScalarTypeDefinition *>(node);
|
203
|
+
return realNode->getDirectives() ? realNode->getDirectives()->size() : 0;
|
204
|
+
}
|
205
|
+
const struct GraphQLAstName * GraphQLAstObjectTypeDefinition_get_name(const struct GraphQLAstObjectTypeDefinition *node) {
|
206
|
+
const auto *realNode = reinterpret_cast<const ObjectTypeDefinition *>(node);
|
207
|
+
return reinterpret_cast<const struct GraphQLAstName *>(&realNode->getName());
|
208
|
+
}
|
209
|
+
int GraphQLAstObjectTypeDefinition_get_interfaces_size(const struct GraphQLAstObjectTypeDefinition *node) {
|
210
|
+
const auto *realNode = reinterpret_cast<const ObjectTypeDefinition *>(node);
|
211
|
+
return realNode->getInterfaces() ? realNode->getInterfaces()->size() : 0;
|
212
|
+
}
|
213
|
+
int GraphQLAstObjectTypeDefinition_get_directives_size(const struct GraphQLAstObjectTypeDefinition *node) {
|
214
|
+
const auto *realNode = reinterpret_cast<const ObjectTypeDefinition *>(node);
|
215
|
+
return realNode->getDirectives() ? realNode->getDirectives()->size() : 0;
|
216
|
+
}
|
217
|
+
int GraphQLAstObjectTypeDefinition_get_fields_size(const struct GraphQLAstObjectTypeDefinition *node) {
|
218
|
+
const auto *realNode = reinterpret_cast<const ObjectTypeDefinition *>(node);
|
219
|
+
return realNode->getFields().size();
|
220
|
+
}
|
221
|
+
const struct GraphQLAstName * GraphQLAstFieldDefinition_get_name(const struct GraphQLAstFieldDefinition *node) {
|
222
|
+
const auto *realNode = reinterpret_cast<const FieldDefinition *>(node);
|
223
|
+
return reinterpret_cast<const struct GraphQLAstName *>(&realNode->getName());
|
224
|
+
}
|
225
|
+
int GraphQLAstFieldDefinition_get_arguments_size(const struct GraphQLAstFieldDefinition *node) {
|
226
|
+
const auto *realNode = reinterpret_cast<const FieldDefinition *>(node);
|
227
|
+
return realNode->getArguments() ? realNode->getArguments()->size() : 0;
|
228
|
+
}
|
229
|
+
const struct GraphQLAstType * GraphQLAstFieldDefinition_get_type(const struct GraphQLAstFieldDefinition *node) {
|
230
|
+
const auto *realNode = reinterpret_cast<const FieldDefinition *>(node);
|
231
|
+
return reinterpret_cast<const struct GraphQLAstType *>(&realNode->getType());
|
232
|
+
}
|
233
|
+
int GraphQLAstFieldDefinition_get_directives_size(const struct GraphQLAstFieldDefinition *node) {
|
234
|
+
const auto *realNode = reinterpret_cast<const FieldDefinition *>(node);
|
235
|
+
return realNode->getDirectives() ? realNode->getDirectives()->size() : 0;
|
236
|
+
}
|
237
|
+
const struct GraphQLAstName * GraphQLAstInputValueDefinition_get_name(const struct GraphQLAstInputValueDefinition *node) {
|
238
|
+
const auto *realNode = reinterpret_cast<const InputValueDefinition *>(node);
|
239
|
+
return reinterpret_cast<const struct GraphQLAstName *>(&realNode->getName());
|
240
|
+
}
|
241
|
+
const struct GraphQLAstType * GraphQLAstInputValueDefinition_get_type(const struct GraphQLAstInputValueDefinition *node) {
|
242
|
+
const auto *realNode = reinterpret_cast<const InputValueDefinition *>(node);
|
243
|
+
return reinterpret_cast<const struct GraphQLAstType *>(&realNode->getType());
|
244
|
+
}
|
245
|
+
const struct GraphQLAstValue * GraphQLAstInputValueDefinition_get_default_value(const struct GraphQLAstInputValueDefinition *node) {
|
246
|
+
const auto *realNode = reinterpret_cast<const InputValueDefinition *>(node);
|
247
|
+
return reinterpret_cast<const struct GraphQLAstValue *>(realNode->getDefaultValue());
|
248
|
+
}
|
249
|
+
int GraphQLAstInputValueDefinition_get_directives_size(const struct GraphQLAstInputValueDefinition *node) {
|
250
|
+
const auto *realNode = reinterpret_cast<const InputValueDefinition *>(node);
|
251
|
+
return realNode->getDirectives() ? realNode->getDirectives()->size() : 0;
|
252
|
+
}
|
253
|
+
const struct GraphQLAstName * GraphQLAstInterfaceTypeDefinition_get_name(const struct GraphQLAstInterfaceTypeDefinition *node) {
|
254
|
+
const auto *realNode = reinterpret_cast<const InterfaceTypeDefinition *>(node);
|
255
|
+
return reinterpret_cast<const struct GraphQLAstName *>(&realNode->getName());
|
256
|
+
}
|
257
|
+
int GraphQLAstInterfaceTypeDefinition_get_directives_size(const struct GraphQLAstInterfaceTypeDefinition *node) {
|
258
|
+
const auto *realNode = reinterpret_cast<const InterfaceTypeDefinition *>(node);
|
259
|
+
return realNode->getDirectives() ? realNode->getDirectives()->size() : 0;
|
260
|
+
}
|
261
|
+
int GraphQLAstInterfaceTypeDefinition_get_fields_size(const struct GraphQLAstInterfaceTypeDefinition *node) {
|
262
|
+
const auto *realNode = reinterpret_cast<const InterfaceTypeDefinition *>(node);
|
263
|
+
return realNode->getFields().size();
|
264
|
+
}
|
265
|
+
const struct GraphQLAstName * GraphQLAstUnionTypeDefinition_get_name(const struct GraphQLAstUnionTypeDefinition *node) {
|
266
|
+
const auto *realNode = reinterpret_cast<const UnionTypeDefinition *>(node);
|
267
|
+
return reinterpret_cast<const struct GraphQLAstName *>(&realNode->getName());
|
268
|
+
}
|
269
|
+
int GraphQLAstUnionTypeDefinition_get_directives_size(const struct GraphQLAstUnionTypeDefinition *node) {
|
270
|
+
const auto *realNode = reinterpret_cast<const UnionTypeDefinition *>(node);
|
271
|
+
return realNode->getDirectives() ? realNode->getDirectives()->size() : 0;
|
272
|
+
}
|
273
|
+
int GraphQLAstUnionTypeDefinition_get_types_size(const struct GraphQLAstUnionTypeDefinition *node) {
|
274
|
+
const auto *realNode = reinterpret_cast<const UnionTypeDefinition *>(node);
|
275
|
+
return realNode->getTypes().size();
|
276
|
+
}
|
277
|
+
const struct GraphQLAstName * GraphQLAstEnumTypeDefinition_get_name(const struct GraphQLAstEnumTypeDefinition *node) {
|
278
|
+
const auto *realNode = reinterpret_cast<const EnumTypeDefinition *>(node);
|
279
|
+
return reinterpret_cast<const struct GraphQLAstName *>(&realNode->getName());
|
280
|
+
}
|
281
|
+
int GraphQLAstEnumTypeDefinition_get_directives_size(const struct GraphQLAstEnumTypeDefinition *node) {
|
282
|
+
const auto *realNode = reinterpret_cast<const EnumTypeDefinition *>(node);
|
283
|
+
return realNode->getDirectives() ? realNode->getDirectives()->size() : 0;
|
284
|
+
}
|
285
|
+
int GraphQLAstEnumTypeDefinition_get_values_size(const struct GraphQLAstEnumTypeDefinition *node) {
|
286
|
+
const auto *realNode = reinterpret_cast<const EnumTypeDefinition *>(node);
|
287
|
+
return realNode->getValues().size();
|
288
|
+
}
|
289
|
+
const struct GraphQLAstName * GraphQLAstEnumValueDefinition_get_name(const struct GraphQLAstEnumValueDefinition *node) {
|
290
|
+
const auto *realNode = reinterpret_cast<const EnumValueDefinition *>(node);
|
291
|
+
return reinterpret_cast<const struct GraphQLAstName *>(&realNode->getName());
|
292
|
+
}
|
293
|
+
int GraphQLAstEnumValueDefinition_get_directives_size(const struct GraphQLAstEnumValueDefinition *node) {
|
294
|
+
const auto *realNode = reinterpret_cast<const EnumValueDefinition *>(node);
|
295
|
+
return realNode->getDirectives() ? realNode->getDirectives()->size() : 0;
|
296
|
+
}
|
297
|
+
const struct GraphQLAstName * GraphQLAstInputObjectTypeDefinition_get_name(const struct GraphQLAstInputObjectTypeDefinition *node) {
|
298
|
+
const auto *realNode = reinterpret_cast<const InputObjectTypeDefinition *>(node);
|
299
|
+
return reinterpret_cast<const struct GraphQLAstName *>(&realNode->getName());
|
300
|
+
}
|
301
|
+
int GraphQLAstInputObjectTypeDefinition_get_directives_size(const struct GraphQLAstInputObjectTypeDefinition *node) {
|
302
|
+
const auto *realNode = reinterpret_cast<const InputObjectTypeDefinition *>(node);
|
303
|
+
return realNode->getDirectives() ? realNode->getDirectives()->size() : 0;
|
304
|
+
}
|
305
|
+
int GraphQLAstInputObjectTypeDefinition_get_fields_size(const struct GraphQLAstInputObjectTypeDefinition *node) {
|
306
|
+
const auto *realNode = reinterpret_cast<const InputObjectTypeDefinition *>(node);
|
307
|
+
return realNode->getFields().size();
|
308
|
+
}
|
309
|
+
const struct GraphQLAstObjectTypeDefinition * GraphQLAstTypeExtensionDefinition_get_definition(const struct GraphQLAstTypeExtensionDefinition *node) {
|
310
|
+
const auto *realNode = reinterpret_cast<const TypeExtensionDefinition *>(node);
|
311
|
+
return reinterpret_cast<const struct GraphQLAstObjectTypeDefinition *>(&realNode->getDefinition());
|
312
|
+
}
|
313
|
+
const struct GraphQLAstName * GraphQLAstDirectiveDefinition_get_name(const struct GraphQLAstDirectiveDefinition *node) {
|
314
|
+
const auto *realNode = reinterpret_cast<const DirectiveDefinition *>(node);
|
315
|
+
return reinterpret_cast<const struct GraphQLAstName *>(&realNode->getName());
|
316
|
+
}
|
317
|
+
int GraphQLAstDirectiveDefinition_get_arguments_size(const struct GraphQLAstDirectiveDefinition *node) {
|
318
|
+
const auto *realNode = reinterpret_cast<const DirectiveDefinition *>(node);
|
319
|
+
return realNode->getArguments() ? realNode->getArguments()->size() : 0;
|
320
|
+
}
|
321
|
+
int GraphQLAstDirectiveDefinition_get_locations_size(const struct GraphQLAstDirectiveDefinition *node) {
|
322
|
+
const auto *realNode = reinterpret_cast<const DirectiveDefinition *>(node);
|
323
|
+
return realNode->getLocations().size();
|
324
|
+
}
|