Skip to content

Commit 5528966

Browse files
committed
Namespace cleanup for #52
1 parent 4d2bd2c commit 5528966

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+130
-126
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ exposes an instance of [GraphiQL](https://github.com/graphql/graphiql) on top of
3838

3939
## Installation process
4040

41-
I've tested this on Windows with Visual Studio 2019 and Linux using an Ubuntu 18.04 LTS instance running in WSL with
42-
both gcc 7.3.0 and clang 6.0.0. The key compiler requirement is support for C++17, recent updates to Visual Studio 2017
43-
will probably work too.
41+
I've tested this on Windows with both Visual Studio 2017 and 2019, and on Linux using an Ubuntu 18.04 LTS instance running in
42+
WSL with both gcc 7.3.0 and clang 6.0.0. The key compiler requirement is support for C++17, earlier versions of gcc and clang
43+
may not have enough support for that.
4444

4545
The easiest way to get all of these and to build `cppgraphqlgen` in one step is to use
4646
[Microsoft/vcpkg](https://github.com/Microsoft/vcpkg). To install with vcpkg, make sure you've pulled the latest version
@@ -127,7 +127,7 @@ configuration.
127127
## API references
128128

129129
See [GraphQLService.h](include/graphqlservice/GraphQLService.h) for the base types implemented in
130-
the `facebook::graphql::service` namespace. Take a look at [UnifiedToday.h](samples/today/UnifiedToday.h) and
130+
the `graphql::service` namespace. Take a look at [UnifiedToday.h](samples/today/UnifiedToday.h) and
131131
[UnifiedToday.cpp](samples/today/UnifiedToday.cpp) to see a sample implementation of a custom schema defined
132132
in [schema.today.graphql](samples/today/schema.today.graphql) for testing purposes.
133133

include/SchemaGenerator.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include <array>
1010
#include <cstdio>
1111

12-
namespace facebook::graphql::schema {
12+
namespace graphql::schema {
1313

1414
// These are the set of built-in types in GraphQL.
1515
enum class BuiltinType
@@ -384,4 +384,4 @@ class Generator
384384
OperationTypeList _operationTypes;
385385
};
386386

387-
} /* namespace facebook::graphql::schema */
387+
} /* namespace graphql::schema */

include/graphqlservice/GraphQLGrammar.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
#include <functional>
1717

18-
namespace facebook::graphql::peg {
18+
namespace graphql::peg {
1919

2020
using namespace tao::graphqlpeg;
2121

@@ -1315,4 +1315,4 @@ struct document
13151315
{
13161316
};
13171317

1318-
} /* namespace facebook::graphql::peg */
1318+
} /* namespace graphql::peg */

include/graphqlservice/GraphQLParse.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#include <memory>
77
#include <string_view>
88

9-
namespace facebook::graphql {
9+
namespace graphql {
1010
namespace peg {
1111

1212
struct ast_node;
@@ -25,4 +25,4 @@ ast parseFile(std::string_view filename);
2525

2626
peg::ast operator "" _graphql(const char* text, size_t size);
2727

28-
} /* namespace facebook::graphql */
28+
} /* namespace graphql */

include/graphqlservice/GraphQLResponse.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#include <vector>
99
#include <unordered_map>
1010

11-
namespace facebook::graphql::response {
11+
namespace graphql::response {
1212

1313
// GraphQL responses are not technically JSON-specific, although that is probably the most common
1414
// way of representing them. These are the primitive types that may be represented in GraphQL, as
@@ -101,4 +101,4 @@ struct Value
101101
std::unique_ptr<TypedData> _data;
102102
};
103103

104-
} /* namespace facebook::graphql::response */
104+
} /* namespace graphql::response */

include/graphqlservice/GraphQLService.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include <map>
2424
#include <set>
2525

26-
namespace facebook::graphql::service {
26+
namespace graphql::service {
2727

2828
// This exception bubbles up 1 or more error messages to the JSON results.
2929
class schema_exception : public std::exception
@@ -48,6 +48,8 @@ struct RequestState : std::enable_shared_from_this<RequestState>
4848
{
4949
};
5050

51+
namespace {
52+
5153
using namespace std::literals;
5254

5355
constexpr std::string_view strData{ "data"sv };
@@ -57,6 +59,8 @@ constexpr std::string_view strQuery{ "query"sv };
5759
constexpr std::string_view strMutation{ "mutation"sv };
5860
constexpr std::string_view strSubscription{ "subscription"sv };
5961

62+
}
63+
6064
// Pass a common bundle of parameters to all of the generated Object::getField accessors in a SelectionSet
6165
struct SelectionSetParams
6266
{
@@ -707,4 +711,4 @@ class Request : public std::enable_shared_from_this<Request>
707711
SubscriptionKey _nextKey = 0;
708712
};
709713

710-
} /* namespace facebook::graphql::service */
714+
} /* namespace graphql::service */

include/graphqlservice/GraphQLTree.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#include <variant>
1313
#include <vector>
1414

15-
namespace facebook::graphql::peg {
15+
namespace graphql::peg {
1616

1717
using namespace tao::graphqlpeg;
1818

@@ -26,4 +26,4 @@ struct ast_input
2626
std::variant<std::vector<char>, std::unique_ptr<file_input<>>, std::string_view> data;
2727
};
2828

29-
} /* namespace facebook::graphql::peg */
29+
} /* namespace graphql::peg */

include/graphqlservice/Introspection.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
#include <graphqlservice/IntrospectionSchema.h>
77

8-
namespace facebook::graphql::introspection {
8+
namespace graphql::introspection {
99

1010
class Schema;
1111
class Directive;
@@ -272,4 +272,4 @@ class Directive : public object::Directive
272272
const std::vector<std::shared_ptr<InputValue>> _args;
273273
};
274274

275-
} /* namespace facebook::graphql::introspection */
275+
} /* namespace graphql::introspection */

include/graphqlservice/JSONResponse.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55

66
#include <graphqlservice/GraphQLResponse.h>
77

8-
namespace facebook::graphql::response {
8+
namespace graphql::response {
99

1010
std::string toJSON(Value&& response);
1111

1212
Value parseJSON(const std::string& json);
1313

14-
} /* namespace facebook::graphql::response */
14+
} /* namespace graphql::response */

samples/introspection/IntrospectionSchema.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#include <exception>
1111
#include <array>
1212

13-
namespace facebook::graphql {
13+
namespace graphql {
1414
namespace service {
1515

1616
static const std::array<std::string_view, 8> s_namesTypeKind = {
@@ -592,4 +592,4 @@ void AddTypesToSchema(std::shared_ptr<introspection::Schema> schema)
592592
}
593593

594594
} /* namespace introspection */
595-
} /* namespace facebook::graphql */
595+
} /* namespace graphql */

0 commit comments

Comments
 (0)