You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As you build the `Query`, `Mutation`, and `Subscription` types and their resolution logic, you will be forced to define a concrete type for every reachable GraphQL result, according to its generated protocol:
82
82
83
83
```swift
84
-
structQuery: QueryProtocol{
85
-
// This is required by `QueryProtocol`, and used by GraphQL query resolution.
84
+
structQuery: GraphQLGenerated.Query{
85
+
// This is required by `GraphQLGenerated.Query`, and used by GraphQL query resolution.
All generated types other than `GraphQLContext` and scalar types are namespaced inside of `GraphQLGenerated` to minimize polluting the inheriting package's type namespace.
123
+
122
124
### Root Types
123
125
Root types (Query, Mutation, and Subscription) are modeled as Swift protocols with static method requirements for each field. The user must implement these types and provide them to the `buildGraphQLSchema` function.
Also, by not providing default resolvers based on reflection of the type's properties, we improve performance and setup the inheriting package up well for evolving the schema over time.
157
160
158
161
### Interface Types
159
162
Interfaces are modeled as a protocol with required methods for each relevant field. Implementing objects and interfaces are marked as requiring conformance to the interface protocol.
@@ -214,10 +217,8 @@ public struct EmailAddress: Scalar {
214
217
215
218
## Development Roadmap
216
219
217
-
1. Generated Object namespacing: Especially for Input types, which are commonly suffixed with `Input`, creating `XInputInput` structs. Also, we should minimize interference with the user's namespace as much as possible.
218
-
2. Directives: Directives are currently not supported
219
-
3. Enhanced configuration: There should be configuration options for the build plugin itself
220
-
4. Executable Schema: To work around the immutability of some Schema components, we generate Swift code to fully recreate the defined schema. Instead, we could just add resolver logic to the schema parsed from the `.graphql` file SDL.
220
+
1. Directives: Directives are currently not supported
221
+
2. Executable Schema: To work around the immutability of some Schema components, we generate Swift code to fully recreate the defined schema. Instead, we could just add resolver logic to the schema parsed from the `.graphql` file SDL.
0 commit comments