66#ifndef CLIENTGENERATOR_H
77#define CLIENTGENERATOR_H
88
9- #include " SchemaLoader.h"
109#include " RequestLoader.h"
1110
12- #include " graphqlservice/GraphQLSchema.h"
13-
1411namespace graphql ::generator::client {
1512
1613struct GeneratorPaths
@@ -21,18 +18,15 @@ struct GeneratorPaths
2118
2219struct GeneratorOptions
2320{
24- const std::string requestFilename;
25- const std::string operationName;
2621 const std::optional<GeneratorPaths> paths;
2722 const bool verbose = false ;
28- const bool noIntrospection = false ;
2923};
3024
3125class Generator
3226{
3327public:
3428 // Initialize the generator with the introspection client or a custom GraphQL client.
35- explicit Generator (SchemaOptions&& schemaOptions, GeneratorOptions&& options);
29+ explicit Generator (SchemaOptions&& schemaOptions, RequestOptions&& requestOptions, GeneratorOptions&& options);
3630
3731 // Run the generator and return a list of filenames that were output.
3832 std::vector<std::string> Build () const noexcept ;
@@ -43,10 +37,6 @@ class Generator
4337 std::string getHeaderPath () const noexcept ;
4438 std::string getSourcePath () const noexcept ;
4539
46- void validateRequest () const ;
47- std::shared_ptr<schema::Schema> buildSchema () const ;
48- void addTypesToSchema (const std::shared_ptr<schema::Schema>& schema) const ;
49-
5040 bool outputHeader () const noexcept ;
5141 void outputObjectDeclaration (
5242 std::ostream& headerFile, const ObjectType& objectType, bool isQueryType) const ;
@@ -65,17 +55,13 @@ class Generator
6555 std::string getResultAccessType (const OutputField& result) const noexcept ;
6656 std::string getTypeModifiers (const TypeModifierStack& modifiers) const noexcept ;
6757
68- static std::shared_ptr<const schema::BaseType> getIntrospectionType (
69- const std::shared_ptr<schema::Schema>& schema, std::string_view type,
70- const TypeModifierStack& modifiers) noexcept ;
71-
72- SchemaLoader _loader;
58+ const SchemaLoader _schemaLoader;
59+ const RequestLoader _requestLoader;
7360 const GeneratorOptions _options;
7461 const std::string _headerDir;
7562 const std::string _sourceDir;
7663 const std::string _headerPath;
7764 const std::string _sourcePath;
78- peg::ast _request;
7965};
8066
8167} /* namespace graphql::generator::client */
0 commit comments