@@ -29,7 +29,7 @@ public func validate(
29
29
* (see the language/visitor API). Visitor methods are expected to return
30
30
* GraphQLErrors, or Arrays of GraphQLErrors when invalid.
31
31
*/
32
- func validate(
32
+ public func validate(
33
33
instrumentation: Instrumentation = NoOpInstrumentation,
34
34
schema: GraphQLSchema ,
35
35
ast: Document ,
@@ -62,11 +62,11 @@ func visit(
62
62
return context. errors
63
63
}
64
64
65
- enum HasSelectionSet {
65
+ public enum HasSelectionSet {
66
66
case operation( OperationDefinition )
67
67
case fragment( FragmentDefinition )
68
68
69
- var node : Node {
69
+ public var node : Node {
70
70
switch self {
71
71
case . operation( let operation) :
72
72
return operation
@@ -77,7 +77,7 @@ enum HasSelectionSet {
77
77
}
78
78
79
79
extension HasSelectionSet : Hashable {
80
- func hash( into hasher: inout Hasher ) {
80
+ public func hash( into hasher: inout Hasher ) {
81
81
switch self {
82
82
case . operation( let operation) :
83
83
return hasher. combine ( operation. hashValue)
@@ -86,7 +86,7 @@ extension HasSelectionSet : Hashable {
86
86
}
87
87
}
88
88
89
- static func == ( lhs: HasSelectionSet , rhs: HasSelectionSet ) -> Bool {
89
+ public static func == ( lhs: HasSelectionSet , rhs: HasSelectionSet ) -> Bool {
90
90
switch ( lhs, rhs) {
91
91
case ( . operation( let l) , . operation( let r) ) :
92
92
return l == r
@@ -98,15 +98,15 @@ extension HasSelectionSet : Hashable {
98
98
}
99
99
}
100
100
101
- typealias VariableUsage = ( node: Variable , type: GraphQLInputType ? )
101
+ public typealias VariableUsage = ( node: Variable , type: GraphQLInputType ? )
102
102
103
103
/**
104
104
* An instance of this class is passed as the "this" context to all validators,
105
105
* allowing access to commonly useful contextual information from within a
106
106
* validation rule.
107
107
*/
108
- final class ValidationContext {
109
- let schema : GraphQLSchema
108
+ public final class ValidationContext {
109
+ public let schema : GraphQLSchema
110
110
let ast : Document
111
111
let typeInfo : TypeInfo
112
112
var errors : [ GraphQLError ]
@@ -128,11 +128,11 @@ final class ValidationContext {
128
128
self . recursiveVariableUsages = [ : ]
129
129
}
130
130
131
- func report( error: GraphQLError ) {
131
+ public func report( error: GraphQLError ) {
132
132
errors. append ( error)
133
133
}
134
134
135
- func getFragment( name: String ) -> FragmentDefinition ? {
135
+ public func getFragment( name: String ) -> FragmentDefinition ? {
136
136
var fragments = self . fragments
137
137
138
138
if fragments. isEmpty {
@@ -152,7 +152,7 @@ final class ValidationContext {
152
152
return fragments [ name]
153
153
}
154
154
155
- func getFragmentSpreads( node: SelectionSet ) -> [ FragmentSpread ] {
155
+ public func getFragmentSpreads( node: SelectionSet ) -> [ FragmentSpread ] {
156
156
var spreads = fragmentSpreads [ node]
157
157
158
158
if spreads == nil {
@@ -181,7 +181,7 @@ final class ValidationContext {
181
181
return spreads!
182
182
}
183
183
184
- func getRecursivelyReferencedFragments( operation: OperationDefinition ) -> [ FragmentDefinition ] {
184
+ public func getRecursivelyReferencedFragments( operation: OperationDefinition ) -> [ FragmentDefinition ] {
185
185
var fragments = recursivelyReferencedFragments [ operation]
186
186
187
187
if fragments == nil {
@@ -210,7 +210,7 @@ final class ValidationContext {
210
210
return fragments!
211
211
}
212
212
213
- func getVariableUsages( node: HasSelectionSet ) -> [ VariableUsage ] {
213
+ public func getVariableUsages( node: HasSelectionSet ) -> [ VariableUsage ] {
214
214
var usages = variableUsages [ node]
215
215
216
216
if usages == nil {
@@ -236,7 +236,7 @@ final class ValidationContext {
236
236
return usages!
237
237
}
238
238
239
- func getRecursiveVariableUsages( operation: OperationDefinition ) -> [ VariableUsage ] {
239
+ public func getRecursiveVariableUsages( operation: OperationDefinition ) -> [ VariableUsage ] {
240
240
var usages = recursiveVariableUsages [ operation]
241
241
242
242
if usages == nil {
@@ -254,27 +254,27 @@ final class ValidationContext {
254
254
return usages!
255
255
}
256
256
257
- var type : GraphQLOutputType ? {
257
+ public var type : GraphQLOutputType ? {
258
258
return typeInfo. type
259
259
}
260
260
261
- var parentType : GraphQLCompositeType ? {
261
+ public var parentType : GraphQLCompositeType ? {
262
262
return typeInfo. parentType
263
263
}
264
264
265
- var inputType : GraphQLInputType ? {
265
+ public var inputType : GraphQLInputType ? {
266
266
return typeInfo. inputType
267
267
}
268
268
269
- var fieldDef : GraphQLFieldDefinition ? {
269
+ public var fieldDef : GraphQLFieldDefinition ? {
270
270
return typeInfo. fieldDef
271
271
}
272
272
273
- var directive : GraphQLDirective ? {
273
+ public var directive : GraphQLDirective ? {
274
274
return typeInfo. directive
275
275
}
276
276
277
- var argument : GraphQLArgumentDefinition ? {
277
+ public var argument : GraphQLArgumentDefinition ? {
278
278
return typeInfo. argument
279
279
}
280
280
}
0 commit comments