Skip to content

Commit c93390b

Browse files
committed
fix interface field introspection
1 parent 4c8e56e commit c93390b

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Sources/GraphQL/Type/Introspection.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,17 @@ let __Type: GraphQLObjectType = try! GraphQLObjectType(
275275
return fields
276276
}
277277

278+
if let type = type as? GraphQLInterfaceType {
279+
let fieldMap = type.fields
280+
var fields = Array(fieldMap.values).sorted(by: { $0.name < $1.name })
281+
282+
if !arguments["includeDeprecated"].bool! {
283+
fields = fields.filter({ !$0.isDeprecated })
284+
}
285+
286+
return fields
287+
}
288+
278289
return nil
279290
}
280291
),

0 commit comments

Comments
 (0)