Skip to content

Merge graphintrospection lib back into graphqlservice #197

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions cmake/Version.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

#pragma once

#ifndef VERSION_H
#define VERSION_H
#ifndef GRAPHQLVERSION_H
#define GRAPHQLVERSION_H

#include <string_view>

Expand All @@ -18,4 +18,4 @@ constexpr size_t PatchVersion = @PROJECT_VERSION_PATCH@;

} // namespace graphql::internal

#endif // VERSION_H
#endif // GRAPHQLVERSION_H
3 changes: 1 addition & 2 deletions cmake/cppgraphqlgen-config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ The following import targets are created:
cppgraphqlgen::graphqlpeg
cppgraphqlgen::graphqlresponse
cppgraphqlgen::graphqlservice
cppgraphqlgen::graphqlintrospection
cppgraphqlgen::graphqljson
cppgraphqlgen::graphqlclient
cppgraphqlgen::schemagen
cppgraphqlgen::clientgen

Expand All @@ -23,7 +23,6 @@ The following functions are defined to help with code generation and build targe

update_graphql_schema_files
add_graphql_schema_target
add_graphql_schema_no_introspection_target
update_graphql_client_files
add_graphql_client_target
#]=======================================================================]
Expand Down
15 changes: 1 addition & 14 deletions cmake/cppgraphqlgen-functions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,7 @@ function(add_graphql_schema_target SCHEMA_TARGET)
add_library(${SCHEMA_TARGET}_schema STATIC ${SCHEMA_FILES})
add_dependencies(${SCHEMA_TARGET}_schema ${SCHEMA_TARGET}_update_schema)
target_include_directories(${SCHEMA_TARGET}_schema PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
target_link_libraries(${SCHEMA_TARGET}_schema PUBLIC cppgraphqlgen::graphqlintrospection)
endif()
endfunction()

function(add_graphql_schema_no_introspection_target SCHEMA_NO_INTROSPECTION_TARGET)
add_custom_target(${SCHEMA_NO_INTROSPECTION_TARGET}_update_schema ALL
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${SCHEMA_NO_INTROSPECTION_TARGET}_schema_files)

if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${SCHEMA_NO_INTROSPECTION_TARGET}_schema_files)
file(STRINGS ${CMAKE_CURRENT_SOURCE_DIR}/${SCHEMA_NO_INTROSPECTION_TARGET}_schema_files SCHEMA_FILES)
add_library(${SCHEMA_NO_INTROSPECTION_TARGET}_schema STATIC ${SCHEMA_FILES})
add_dependencies(${SCHEMA_NO_INTROSPECTION_TARGET}_schema ${SCHEMA_NO_INTROSPECTION_TARGET}_update_schema)
target_include_directories(${SCHEMA_NO_INTROSPECTION_TARGET}_schema PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
target_link_libraries(${SCHEMA_NO_INTROSPECTION_TARGET}_schema PUBLIC cppgraphqlgen::graphqlservice)
target_link_libraries(${SCHEMA_TARGET}_schema PUBLIC cppgraphqlgen::graphqlservice)
endif()
endfunction()

Expand Down
2 changes: 1 addition & 1 deletion cmake/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.0.1
4.1.0
6 changes: 3 additions & 3 deletions include/graphqlservice/internal/Awaitable.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

#pragma once

#ifndef Awaitable_H
#define Awaitable_H
#ifndef GRAPHQLAWAITABLE_H
#define GRAPHQLAWAITABLE_H

// clang-format off
#ifdef USE_STD_EXPERIMENTAL_COROUTINE
Expand Down Expand Up @@ -159,4 +159,4 @@ class Awaitable

} // namespace graphql::internal

#endif // Awaitable_H
#endif // GRAPHQLAWAITABLE_H
6 changes: 3 additions & 3 deletions include/graphqlservice/internal/Base64.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

#pragma once

#ifndef BASE64_H
#define BASE64_H
#ifndef GRAPHQLBASE64_H
#define GRAPHQLBASE64_H

// clang-format off
#ifdef GRAPHQL_DLLEXPORTS
Expand Down Expand Up @@ -68,4 +68,4 @@ class Base64

} // namespace graphql::internal

#endif // BASE64_H
#endif // GRAPHQLBASE64_H
82 changes: 41 additions & 41 deletions include/graphqlservice/internal/Introspection.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ class EnumValue;
class Schema
{
public:
GRAPHQLINTROSPECTION_EXPORT explicit Schema(const std::shared_ptr<schema::Schema>& schema);
GRAPHQLSERVICE_EXPORT explicit Schema(const std::shared_ptr<schema::Schema>& schema);

// Accessors
GRAPHQLINTROSPECTION_EXPORT std::optional<std::string> getDescription() const;
GRAPHQLINTROSPECTION_EXPORT std::vector<std::shared_ptr<object::Type>> getTypes() const;
GRAPHQLINTROSPECTION_EXPORT std::shared_ptr<object::Type> getQueryType() const;
GRAPHQLINTROSPECTION_EXPORT std::shared_ptr<object::Type> getMutationType() const;
GRAPHQLINTROSPECTION_EXPORT std::shared_ptr<object::Type> getSubscriptionType() const;
GRAPHQLINTROSPECTION_EXPORT std::vector<std::shared_ptr<object::Directive>> getDirectives()
GRAPHQLSERVICE_EXPORT std::optional<std::string> getDescription() const;
GRAPHQLSERVICE_EXPORT std::vector<std::shared_ptr<object::Type>> getTypes() const;
GRAPHQLSERVICE_EXPORT std::shared_ptr<object::Type> getQueryType() const;
GRAPHQLSERVICE_EXPORT std::shared_ptr<object::Type> getMutationType() const;
GRAPHQLSERVICE_EXPORT std::shared_ptr<object::Type> getSubscriptionType() const;
GRAPHQLSERVICE_EXPORT std::vector<std::shared_ptr<object::Directive>> getDirectives()
const;

private:
Expand All @@ -40,24 +40,24 @@ class Schema
class Type
{
public:
GRAPHQLINTROSPECTION_EXPORT explicit Type(const std::shared_ptr<const schema::BaseType>& type);
GRAPHQLSERVICE_EXPORT explicit Type(const std::shared_ptr<const schema::BaseType>& type);

// Accessors
GRAPHQLINTROSPECTION_EXPORT TypeKind getKind() const;
GRAPHQLINTROSPECTION_EXPORT std::optional<std::string> getName() const;
GRAPHQLINTROSPECTION_EXPORT std::optional<std::string> getDescription() const;
GRAPHQLINTROSPECTION_EXPORT std::optional<std::vector<std::shared_ptr<object::Field>>>
GRAPHQLSERVICE_EXPORT TypeKind getKind() const;
GRAPHQLSERVICE_EXPORT std::optional<std::string> getName() const;
GRAPHQLSERVICE_EXPORT std::optional<std::string> getDescription() const;
GRAPHQLSERVICE_EXPORT std::optional<std::vector<std::shared_ptr<object::Field>>>
getFields(std::optional<bool>&& includeDeprecatedArg) const;
GRAPHQLINTROSPECTION_EXPORT std::optional<std::vector<std::shared_ptr<object::Type>>>
GRAPHQLSERVICE_EXPORT std::optional<std::vector<std::shared_ptr<object::Type>>>
getInterfaces() const;
GRAPHQLINTROSPECTION_EXPORT std::optional<std::vector<std::shared_ptr<object::Type>>>
GRAPHQLSERVICE_EXPORT std::optional<std::vector<std::shared_ptr<object::Type>>>
getPossibleTypes() const;
GRAPHQLINTROSPECTION_EXPORT std::optional<std::vector<std::shared_ptr<object::EnumValue>>>
GRAPHQLSERVICE_EXPORT std::optional<std::vector<std::shared_ptr<object::EnumValue>>>
getEnumValues(std::optional<bool>&& includeDeprecatedArg) const;
GRAPHQLINTROSPECTION_EXPORT std::optional<std::vector<std::shared_ptr<object::InputValue>>>
GRAPHQLSERVICE_EXPORT std::optional<std::vector<std::shared_ptr<object::InputValue>>>
getInputFields() const;
GRAPHQLINTROSPECTION_EXPORT std::shared_ptr<object::Type> getOfType() const;
GRAPHQLINTROSPECTION_EXPORT std::optional<std::string> getSpecifiedByURL() const;
GRAPHQLSERVICE_EXPORT std::shared_ptr<object::Type> getOfType() const;
GRAPHQLSERVICE_EXPORT std::optional<std::string> getSpecifiedByURL() const;

private:
const std::shared_ptr<const schema::BaseType> _type;
Expand All @@ -66,15 +66,15 @@ class Type
class Field
{
public:
GRAPHQLINTROSPECTION_EXPORT explicit Field(const std::shared_ptr<const schema::Field>& field);
GRAPHQLSERVICE_EXPORT explicit Field(const std::shared_ptr<const schema::Field>& field);

// Accessors
GRAPHQLINTROSPECTION_EXPORT std::string getName() const;
GRAPHQLINTROSPECTION_EXPORT std::optional<std::string> getDescription() const;
GRAPHQLINTROSPECTION_EXPORT std::vector<std::shared_ptr<object::InputValue>> getArgs() const;
GRAPHQLINTROSPECTION_EXPORT std::shared_ptr<object::Type> getType() const;
GRAPHQLINTROSPECTION_EXPORT bool getIsDeprecated() const;
GRAPHQLINTROSPECTION_EXPORT std::optional<std::string> getDeprecationReason() const;
GRAPHQLSERVICE_EXPORT std::string getName() const;
GRAPHQLSERVICE_EXPORT std::optional<std::string> getDescription() const;
GRAPHQLSERVICE_EXPORT std::vector<std::shared_ptr<object::InputValue>> getArgs() const;
GRAPHQLSERVICE_EXPORT std::shared_ptr<object::Type> getType() const;
GRAPHQLSERVICE_EXPORT bool getIsDeprecated() const;
GRAPHQLSERVICE_EXPORT std::optional<std::string> getDeprecationReason() const;

private:
const std::shared_ptr<const schema::Field> _field;
Expand All @@ -83,14 +83,14 @@ class Field
class InputValue
{
public:
GRAPHQLINTROSPECTION_EXPORT explicit InputValue(
GRAPHQLSERVICE_EXPORT explicit InputValue(
const std::shared_ptr<const schema::InputValue>& inputValue);

// Accessors
GRAPHQLINTROSPECTION_EXPORT std::string getName() const;
GRAPHQLINTROSPECTION_EXPORT std::optional<std::string> getDescription() const;
GRAPHQLINTROSPECTION_EXPORT std::shared_ptr<object::Type> getType() const;
GRAPHQLINTROSPECTION_EXPORT std::optional<std::string> getDefaultValue() const;
GRAPHQLSERVICE_EXPORT std::string getName() const;
GRAPHQLSERVICE_EXPORT std::optional<std::string> getDescription() const;
GRAPHQLSERVICE_EXPORT std::shared_ptr<object::Type> getType() const;
GRAPHQLSERVICE_EXPORT std::optional<std::string> getDefaultValue() const;

private:
const std::shared_ptr<const schema::InputValue> _inputValue;
Expand All @@ -99,14 +99,14 @@ class InputValue
class EnumValue
{
public:
GRAPHQLINTROSPECTION_EXPORT explicit EnumValue(
GRAPHQLSERVICE_EXPORT explicit EnumValue(
const std::shared_ptr<const schema::EnumValue>& enumValue);

// Accessors
GRAPHQLINTROSPECTION_EXPORT std::string getName() const;
GRAPHQLINTROSPECTION_EXPORT std::optional<std::string> getDescription() const;
GRAPHQLINTROSPECTION_EXPORT bool getIsDeprecated() const;
GRAPHQLINTROSPECTION_EXPORT std::optional<std::string> getDeprecationReason() const;
GRAPHQLSERVICE_EXPORT std::string getName() const;
GRAPHQLSERVICE_EXPORT std::optional<std::string> getDescription() const;
GRAPHQLSERVICE_EXPORT bool getIsDeprecated() const;
GRAPHQLSERVICE_EXPORT std::optional<std::string> getDeprecationReason() const;

private:
const std::shared_ptr<const schema::EnumValue> _enumValue;
Expand All @@ -115,15 +115,15 @@ class EnumValue
class Directive
{
public:
GRAPHQLINTROSPECTION_EXPORT explicit Directive(
GRAPHQLSERVICE_EXPORT explicit Directive(
const std::shared_ptr<const schema::Directive>& directive);

// Accessors
GRAPHQLINTROSPECTION_EXPORT std::string getName() const;
GRAPHQLINTROSPECTION_EXPORT std::optional<std::string> getDescription() const;
GRAPHQLINTROSPECTION_EXPORT std::vector<DirectiveLocation> getLocations() const;
GRAPHQLINTROSPECTION_EXPORT std::vector<std::shared_ptr<object::InputValue>> getArgs() const;
GRAPHQLINTROSPECTION_EXPORT bool getIsRepeatable() const;
GRAPHQLSERVICE_EXPORT std::string getName() const;
GRAPHQLSERVICE_EXPORT std::optional<std::string> getDescription() const;
GRAPHQLSERVICE_EXPORT std::vector<DirectiveLocation> getLocations() const;
GRAPHQLSERVICE_EXPORT std::vector<std::shared_ptr<object::InputValue>> getArgs() const;
GRAPHQLSERVICE_EXPORT bool getIsRepeatable() const;

private:
const std::shared_ptr<const schema::Directive> _directive;
Expand Down
6 changes: 3 additions & 3 deletions include/graphqlservice/internal/SortedMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

#pragma once

#ifndef SORTEDMAP_H
#define SORTEDMAP_H
#ifndef GRAPHQLSORTEDMAP_H
#define GRAPHQLSORTEDMAP_H

#include <algorithm>
#include <functional>
Expand Down Expand Up @@ -363,4 +363,4 @@ using string_view_set = sorted_set<std::string_view, shorter_or_less>;

} // namespace graphql::internal

#endif // SORTEDMAP_H
#endif // GRAPHQLSORTEDMAP_H
6 changes: 3 additions & 3 deletions include/graphqlservice/internal/SyntaxTree.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

#pragma once

#ifndef GRAPHQLTREE_H
#define GRAPHQLTREE_H
#ifndef GRAPHQLSYNTAXTREE_H
#define GRAPHQLSYNTAXTREE_H

#include "graphqlservice/GraphQLParse.h"

Expand Down Expand Up @@ -153,4 +153,4 @@ struct ast_input

} // namespace graphql::peg

#endif // GRAPHQLTREE_H
#endif // GRAPHQLSYNTAXTREE_H
12 changes: 6 additions & 6 deletions include/graphqlservice/internal/Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@

#pragma once

#ifndef VERSION_H
#define VERSION_H
#ifndef GRAPHQLVERSION_H
#define GRAPHQLVERSION_H

#include <string_view>

namespace graphql::internal {

constexpr std::string_view FullVersion { "4.0.1" };
constexpr std::string_view FullVersion { "4.1.0" };

constexpr size_t MajorVersion = 4;
constexpr size_t MinorVersion = 0;
constexpr size_t PatchVersion = 1;
constexpr size_t MinorVersion = 1;
constexpr size_t PatchVersion = 0;

} // namespace graphql::internal

#endif // VERSION_H
#endif // GRAPHQLVERSION_H
4 changes: 2 additions & 2 deletions include/graphqlservice/introspection/DirectiveObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ class Directive
service::ResolverMap getResolvers() const noexcept;

public:
GRAPHQLINTROSPECTION_EXPORT Directive(std::shared_ptr<introspection::Directive> pimpl) noexcept;
GRAPHQLINTROSPECTION_EXPORT ~Directive();
GRAPHQLSERVICE_EXPORT Directive(std::shared_ptr<introspection::Directive> pimpl) noexcept;
GRAPHQLSERVICE_EXPORT ~Directive();
};

} // namespace graphql::introspection::object
Expand Down
4 changes: 2 additions & 2 deletions include/graphqlservice/introspection/EnumValueObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ class EnumValue
service::ResolverMap getResolvers() const noexcept;

public:
GRAPHQLINTROSPECTION_EXPORT EnumValue(std::shared_ptr<introspection::EnumValue> pimpl) noexcept;
GRAPHQLINTROSPECTION_EXPORT ~EnumValue();
GRAPHQLSERVICE_EXPORT EnumValue(std::shared_ptr<introspection::EnumValue> pimpl) noexcept;
GRAPHQLSERVICE_EXPORT ~EnumValue();
};

} // namespace graphql::introspection::object
Expand Down
4 changes: 2 additions & 2 deletions include/graphqlservice/introspection/FieldObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ class Field
service::ResolverMap getResolvers() const noexcept;

public:
GRAPHQLINTROSPECTION_EXPORT Field(std::shared_ptr<introspection::Field> pimpl) noexcept;
GRAPHQLINTROSPECTION_EXPORT ~Field();
GRAPHQLSERVICE_EXPORT Field(std::shared_ptr<introspection::Field> pimpl) noexcept;
GRAPHQLSERVICE_EXPORT ~Field();
};

} // namespace graphql::introspection::object
Expand Down
4 changes: 2 additions & 2 deletions include/graphqlservice/introspection/InputValueObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ class InputValue
service::ResolverMap getResolvers() const noexcept;

public:
GRAPHQLINTROSPECTION_EXPORT InputValue(std::shared_ptr<introspection::InputValue> pimpl) noexcept;
GRAPHQLINTROSPECTION_EXPORT ~InputValue();
GRAPHQLSERVICE_EXPORT InputValue(std::shared_ptr<introspection::InputValue> pimpl) noexcept;
GRAPHQLSERVICE_EXPORT ~InputValue();
};

} // namespace graphql::introspection::object
Expand Down
Loading