Skip to content

Fixing bugs and CI workflows #279

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 20, 2023
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
4 changes: 2 additions & 2 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
matrix:
config: [Debug, Release]

runs-on: macos-11
runs-on: macos-latest

steps:
- uses: actions/checkout@v2
Expand All @@ -31,7 +31,7 @@ jobs:
shell: pwsh
working-directory: build/
run: |
$vcpkgToolchain = Join-Path $env:VCPKG_ROOT './scripts/buildsystems/vcpkg.cmake' -Resolve
$vcpkgToolchain = Join-Path $env:VCPKG_INSTALLATION_ROOT './scripts/buildsystems/vcpkg.cmake' -Resolve
$cmakeBuildType = '${{ matrix.config }}'

cmake "-DCMAKE_TOOLCHAIN_FILE=$vcpkgToolchain" "-DCMAKE_BUILD_TYPE=$cmakeBuildType" ${{ github.workspace }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
shell: pwsh
working-directory: build/
run: |
$vcpkgToolchain = Join-Path $env:VCPKG_ROOT '.\scripts\buildsystems\vcpkg.cmake' -Resolve
$vcpkgToolchain = Join-Path $env:VCPKG_INSTALLATION_ROOT '.\scripts\buildsystems\vcpkg.cmake' -Resolve
$vcpkgTriplet = '${{ steps.set-variables.outputs.vcpkg_triplet }}'
$cmakeSharedLibs = $(if ('${{ matrix.libs }}' -eq 'shared') { 'ON' } else { 'OFF' })
$msbuildArch = $(if ('${{ matrix.arch }}' -eq 'x64') { 'X64' } else { 'Win32' })
Expand Down
4 changes: 2 additions & 2 deletions include/graphqlservice/GraphQLService.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ struct [[nodiscard]] RequestState : std::enable_shared_from_this<RequestState>
virtual ~RequestState() = default;
};

namespace {
inline namespace keywords {

using namespace std::literals;

Expand All @@ -131,7 +131,7 @@ constexpr std::string_view strQuery { "query"sv };
constexpr std::string_view strMutation { "mutation"sv };
constexpr std::string_view strSubscription { "subscription"sv };

} // namespace
} // namespace keywords

// Resolvers may be called in multiple different Operation contexts.
enum class [[nodiscard]] ResolverContext {
Expand Down
6 changes: 1 addition & 5 deletions samples/client/multiple/MultipleQueriesClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,7 @@ CompleteTaskInput::CompleteTaskInput(CompleteTaskInput&& other) noexcept

CompleteTaskInput& CompleteTaskInput::operator=(const CompleteTaskInput& other)
{
CompleteTaskInput value { other };

std::swap(*this, value);

return *this;
return *this = CompleteTaskInput { other };
}

CompleteTaskInput& CompleteTaskInput::operator=(CompleteTaskInput&& other) noexcept
Expand Down
6 changes: 1 addition & 5 deletions samples/client/mutate/MutateClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,7 @@ CompleteTaskInput::CompleteTaskInput(CompleteTaskInput&& other) noexcept

CompleteTaskInput& CompleteTaskInput::operator=(const CompleteTaskInput& other)
{
CompleteTaskInput value { other };

std::swap(*this, value);

return *this;
return *this = CompleteTaskInput { other };
}

CompleteTaskInput& CompleteTaskInput::operator=(CompleteTaskInput&& other) noexcept
Expand Down
32 changes: 11 additions & 21 deletions samples/client/nestedinput/NestedInputClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,7 @@ InputA::InputA(InputA&& other) noexcept

InputA& InputA::operator=(const InputA& other)
{
InputA value { other };

std::swap(*this, value);

return *this;
return *this = InputA { other };
}

InputA& InputA::operator=(InputA&& other) noexcept
Expand Down Expand Up @@ -98,11 +94,7 @@ InputB::InputB(InputB&& other) noexcept

InputB& InputB::operator=(const InputB& other)
{
InputB value { other };

std::swap(*this, value);

return *this;
return *this = InputB { other };
}

InputB& InputB::operator=(InputB&& other) noexcept
Expand All @@ -116,11 +108,13 @@ InputABCD::InputABCD(
std::string dArg,
InputA aArg,
InputB bArg,
std::vector<InputBC> bcArg) noexcept
std::vector<InputBC> bcArg,
int valueArg) noexcept
: d { std::move(dArg) }
, a { std::move(aArg) }
, b { std::move(bArg) }
, bc { std::move(bcArg) }
, value { std::move(valueArg) }
{
}

Expand All @@ -129,6 +123,7 @@ InputABCD::InputABCD(const InputABCD& other)
, a { ModifiedVariable<InputA>::duplicate(other.a) }
, b { ModifiedVariable<InputB>::duplicate(other.b) }
, bc { ModifiedVariable<InputBC>::duplicate<TypeModifier::List>(other.bc) }
, value { ModifiedVariable<int>::duplicate(other.value) }
{
}

Expand All @@ -137,16 +132,13 @@ InputABCD::InputABCD(InputABCD&& other) noexcept
, a { std::move(other.a) }
, b { std::move(other.b) }
, bc { std::move(other.bc) }
, value { std::move(other.value) }
{
}

InputABCD& InputABCD::operator=(const InputABCD& other)
{
InputABCD value { other };

std::swap(*this, value);

return *this;
return *this = InputABCD { other };
}

InputABCD& InputABCD::operator=(InputABCD&& other) noexcept
Expand All @@ -155,6 +147,7 @@ InputABCD& InputABCD::operator=(InputABCD&& other) noexcept
a = std::move(other.a);
b = std::move(other.b);
bc = std::move(other.bc);
value = std::move(other.value);

return *this;
}
Expand All @@ -181,11 +174,7 @@ InputBC::InputBC(InputBC&& other) noexcept

InputBC& InputBC::operator=(const InputBC& other)
{
InputBC value { other };

std::swap(*this, value);

return *this;
return *this = InputBC { other };
}

InputBC& InputBC::operator=(InputBC&& other) noexcept
Expand Down Expand Up @@ -229,6 +218,7 @@ response::Value Variable<InputABCD>::serialize(InputABCD&& inputValue)
result.emplace_back(R"js(a)js"s, ModifiedVariable<InputA>::serialize(std::move(inputValue.a)));
result.emplace_back(R"js(b)js"s, ModifiedVariable<InputB>::serialize(std::move(inputValue.b)));
result.emplace_back(R"js(bc)js"s, ModifiedVariable<InputBC>::serialize<TypeModifier::List>(std::move(inputValue.bc)));
result.emplace_back(R"js(value)js"s, ModifiedVariable<int>::serialize(std::move(inputValue.value)));

return result;
}
Expand Down
4 changes: 3 additions & 1 deletion samples/client/nestedinput/NestedInputClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ struct [[nodiscard]] InputABCD
std::string dArg = std::string {},
InputA aArg = InputA {},
InputB bArg = InputB {},
std::vector<InputBC> bcArg = std::vector<InputBC> {}) noexcept;
std::vector<InputBC> bcArg = std::vector<InputBC> {},
int valueArg = int {}) noexcept;
InputABCD(const InputABCD& other);
InputABCD(InputABCD&& other) noexcept;

Expand All @@ -89,6 +90,7 @@ struct [[nodiscard]] InputABCD
InputA a {};
InputB b {};
std::vector<InputBC> bc {};
int value {};
};

struct [[nodiscard]] InputBC
Expand Down
1 change: 1 addition & 0 deletions samples/client/nestedinput/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ input InputABCD {
a: InputA!
b: InputB!
bc: [InputBC!]!
value: Int!
}

type Output {
Expand Down
6 changes: 1 addition & 5 deletions src/ClientGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -725,11 +725,7 @@ using namespace std::literals;
)cpp" << cppType << R"cpp(& )cpp"
<< cppType << R"cpp(::operator=(const )cpp" << cppType << R"cpp(& other)
{
)cpp" << cppType << R"cpp( value { other };

std::swap(*this, value);

return *this;
return *this = )cpp" << cppType << R"cpp( { other };
}

)cpp" << cppType << R"cpp(& )cpp"
Expand Down