Skip to content

Commit 801026f

Browse files
feature: Adds 'isRepeatable' field to Directives
1 parent 31795b0 commit 801026f

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Sources/GraphQL/Type/Directives.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,21 @@ public struct GraphQLDirective: Encodable {
3131
public let description: String
3232
public let locations: [DirectiveLocation]
3333
public let args: [GraphQLArgumentDefinition]
34+
public let isRepeatable: Bool
3435

3536
public init(
3637
name: String,
3738
description: String = "",
3839
locations: [DirectiveLocation],
39-
args: GraphQLArgumentConfigMap = [:]
40+
args: GraphQLArgumentConfigMap = [:],
41+
isRepeatable: Bool = false
4042
) throws {
4143
try assertValid(name: name)
4244
self.name = name
4345
self.description = description
4446
self.locations = locations
4547
self.args = try defineArgumentMap(args: args)
48+
self.isRepeatable = isRepeatable
4649
}
4750
}
4851

Sources/GraphQL/Type/Introspection.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ let __Directive = try! GraphQLObjectType(
8282
fields: [
8383
"name": GraphQLField(type: GraphQLNonNull(GraphQLString)),
8484
"description": GraphQLField(type: GraphQLString),
85+
"isRepeatable": GraphQLField(type: GraphQLNonNull(GraphQLBoolean)),
8586
"locations": GraphQLField(type: GraphQLNonNull(GraphQLList(GraphQLNonNull(__DirectiveLocation)))),
8687
"args": GraphQLField(
8788
type: GraphQLNonNull(GraphQLList(GraphQLNonNull(__InputValue))),

0 commit comments

Comments
 (0)