We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 25a3a7c commit c4baf42Copy full SHA for c4baf42
Tests/GraphitiTests/SchemaTests.swift
@@ -140,6 +140,29 @@ class SchemaTests: XCTestCase {
140
])
141
)
142
}
143
+
144
+ func testSchemaWithNoQuery() {
145
+ struct User: Codable {
146
+ let id: String
147
+ }
148
149
+ struct TestResolver {}
150
151
+ do {
152
+ let _ = try Schema<TestResolver, NoContext> {
153
+ Type(User.self) {
154
+ Field("id", at: \.id)
155
156
157
+ } catch {
158
+ XCTAssertEqual(
159
+ error as? SchemaError,
160
+ SchemaError(
161
+ description: "Schema must contain at least 1 query or federated resolver"
162
+ )
163
164
165
166
167
168
private class TestAPI<Resolver, ContextType>: API {
0 commit comments