Skip to content

Commit 7f0e166

Browse files
authored
Merge pull request #279 from wravery/bug-fixes
Fixing bugs and CI workflows
2 parents 7e962a2 + d83571f commit 7f0e166

File tree

9 files changed

+23
-42
lines changed

9 files changed

+23
-42
lines changed

.github/workflows/macos.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
matrix:
1010
config: [Debug, Release]
1111

12-
runs-on: macos-11
12+
runs-on: macos-latest
1313

1414
steps:
1515
- uses: actions/checkout@v2
@@ -31,7 +31,7 @@ jobs:
3131
shell: pwsh
3232
working-directory: build/
3333
run: |
34-
$vcpkgToolchain = Join-Path $env:VCPKG_ROOT './scripts/buildsystems/vcpkg.cmake' -Resolve
34+
$vcpkgToolchain = Join-Path $env:VCPKG_INSTALLATION_ROOT './scripts/buildsystems/vcpkg.cmake' -Resolve
3535
$cmakeBuildType = '${{ matrix.config }}'
3636
3737
cmake "-DCMAKE_TOOLCHAIN_FILE=$vcpkgToolchain" "-DCMAKE_BUILD_TYPE=$cmakeBuildType" ${{ github.workspace }}

.github/workflows/windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
shell: pwsh
3939
working-directory: build/
4040
run: |
41-
$vcpkgToolchain = Join-Path $env:VCPKG_ROOT '.\scripts\buildsystems\vcpkg.cmake' -Resolve
41+
$vcpkgToolchain = Join-Path $env:VCPKG_INSTALLATION_ROOT '.\scripts\buildsystems\vcpkg.cmake' -Resolve
4242
$vcpkgTriplet = '${{ steps.set-variables.outputs.vcpkg_triplet }}'
4343
$cmakeSharedLibs = $(if ('${{ matrix.libs }}' -eq 'shared') { 'ON' } else { 'OFF' })
4444
$msbuildArch = $(if ('${{ matrix.arch }}' -eq 'x64') { 'X64' } else { 'Win32' })

include/graphqlservice/GraphQLService.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ struct [[nodiscard]] RequestState : std::enable_shared_from_this<RequestState>
116116
virtual ~RequestState() = default;
117117
};
118118

119-
namespace {
119+
inline namespace keywords {
120120

121121
using namespace std::literals;
122122

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

134-
} // namespace
134+
} // namespace keywords
135135

136136
// Resolvers may be called in multiple different Operation contexts.
137137
enum class [[nodiscard]] ResolverContext {

samples/client/multiple/MultipleQueriesClient.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,7 @@ CompleteTaskInput::CompleteTaskInput(CompleteTaskInput&& other) noexcept
151151

152152
CompleteTaskInput& CompleteTaskInput::operator=(const CompleteTaskInput& other)
153153
{
154-
CompleteTaskInput value { other };
155-
156-
std::swap(*this, value);
157-
158-
return *this;
154+
return *this = CompleteTaskInput { other };
159155
}
160156

161157
CompleteTaskInput& CompleteTaskInput::operator=(CompleteTaskInput&& other) noexcept

samples/client/mutate/MutateClient.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,7 @@ CompleteTaskInput::CompleteTaskInput(CompleteTaskInput&& other) noexcept
8484

8585
CompleteTaskInput& CompleteTaskInput::operator=(const CompleteTaskInput& other)
8686
{
87-
CompleteTaskInput value { other };
88-
89-
std::swap(*this, value);
90-
91-
return *this;
87+
return *this = CompleteTaskInput { other };
9288
}
9389

9490
CompleteTaskInput& CompleteTaskInput::operator=(CompleteTaskInput&& other) noexcept

samples/client/nestedinput/NestedInputClient.cpp

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,7 @@ InputA::InputA(InputA&& other) noexcept
6666

6767
InputA& InputA::operator=(const InputA& other)
6868
{
69-
InputA value { other };
70-
71-
std::swap(*this, value);
72-
73-
return *this;
69+
return *this = InputA { other };
7470
}
7571

7672
InputA& InputA::operator=(InputA&& other) noexcept
@@ -98,11 +94,7 @@ InputB::InputB(InputB&& other) noexcept
9894

9995
InputB& InputB::operator=(const InputB& other)
10096
{
101-
InputB value { other };
102-
103-
std::swap(*this, value);
104-
105-
return *this;
97+
return *this = InputB { other };
10698
}
10799

108100
InputB& InputB::operator=(InputB&& other) noexcept
@@ -116,11 +108,13 @@ InputABCD::InputABCD(
116108
std::string dArg,
117109
InputA aArg,
118110
InputB bArg,
119-
std::vector<InputBC> bcArg) noexcept
111+
std::vector<InputBC> bcArg,
112+
int valueArg) noexcept
120113
: d { std::move(dArg) }
121114
, a { std::move(aArg) }
122115
, b { std::move(bArg) }
123116
, bc { std::move(bcArg) }
117+
, value { std::move(valueArg) }
124118
{
125119
}
126120

@@ -129,6 +123,7 @@ InputABCD::InputABCD(const InputABCD& other)
129123
, a { ModifiedVariable<InputA>::duplicate(other.a) }
130124
, b { ModifiedVariable<InputB>::duplicate(other.b) }
131125
, bc { ModifiedVariable<InputBC>::duplicate<TypeModifier::List>(other.bc) }
126+
, value { ModifiedVariable<int>::duplicate(other.value) }
132127
{
133128
}
134129

@@ -137,16 +132,13 @@ InputABCD::InputABCD(InputABCD&& other) noexcept
137132
, a { std::move(other.a) }
138133
, b { std::move(other.b) }
139134
, bc { std::move(other.bc) }
135+
, value { std::move(other.value) }
140136
{
141137
}
142138

143139
InputABCD& InputABCD::operator=(const InputABCD& other)
144140
{
145-
InputABCD value { other };
146-
147-
std::swap(*this, value);
148-
149-
return *this;
141+
return *this = InputABCD { other };
150142
}
151143

152144
InputABCD& InputABCD::operator=(InputABCD&& other) noexcept
@@ -155,6 +147,7 @@ InputABCD& InputABCD::operator=(InputABCD&& other) noexcept
155147
a = std::move(other.a);
156148
b = std::move(other.b);
157149
bc = std::move(other.bc);
150+
value = std::move(other.value);
158151

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

182175
InputBC& InputBC::operator=(const InputBC& other)
183176
{
184-
InputBC value { other };
185-
186-
std::swap(*this, value);
187-
188-
return *this;
177+
return *this = InputBC { other };
189178
}
190179

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

233223
return result;
234224
}

samples/client/nestedinput/NestedInputClient.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ struct [[nodiscard]] InputABCD
7878
std::string dArg = std::string {},
7979
InputA aArg = InputA {},
8080
InputB bArg = InputB {},
81-
std::vector<InputBC> bcArg = std::vector<InputBC> {}) noexcept;
81+
std::vector<InputBC> bcArg = std::vector<InputBC> {},
82+
int valueArg = int {}) noexcept;
8283
InputABCD(const InputABCD& other);
8384
InputABCD(InputABCD&& other) noexcept;
8485

@@ -89,6 +90,7 @@ struct [[nodiscard]] InputABCD
8990
InputA a {};
9091
InputB b {};
9192
std::vector<InputBC> bc {};
93+
int value {};
9294
};
9395

9496
struct [[nodiscard]] InputBC

samples/client/nestedinput/schema.graphql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ input InputABCD {
1616
a: InputA!
1717
b: InputB!
1818
bc: [InputBC!]!
19+
value: Int!
1920
}
2021

2122
type Output {

src/ClientGenerator.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -725,11 +725,7 @@ using namespace std::literals;
725725
)cpp" << cppType << R"cpp(& )cpp"
726726
<< cppType << R"cpp(::operator=(const )cpp" << cppType << R"cpp(& other)
727727
{
728-
)cpp" << cppType << R"cpp( value { other };
729-
730-
std::swap(*this, value);
731-
732-
return *this;
728+
return *this = )cpp" << cppType << R"cpp( { other };
733729
}
734730
735731
)cpp" << cppType << R"cpp(& )cpp"

0 commit comments

Comments
 (0)