Skip to content

Commit 119aafe

Browse files
Zeeshan LakhaniSean Cribbs
authored andcommitted
Add simple subscription type to satisfy clients that use a newer spec
1 parent 80acb35 commit 119aafe

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

graphql/introspection.lua

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,15 @@ __Schema = types.object({
4444
resolve = function(schema)
4545
return schema.directives
4646
end
47-
}
47+
},
48+
49+
subscriptionType = {
50+
description = 'If this server supports subscriptions, the type that subscription operations will be rooted at',
51+
kind = __Type,
52+
resolve = function(schema)
53+
return schema:getSubscriptionType()
54+
end
55+
}
4856
}
4957
end
5058
})

graphql/schema.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ function schema.create(config)
2626

2727
self:generateTypeMap(self.query)
2828
self:generateTypeMap(self.mutation)
29+
self:generateTypeMap(self.subscription)
2930
self:generateTypeMap(introspection.__Schema)
3031
self:generateDirectiveMap()
3132

@@ -99,6 +100,10 @@ function schema:getMutationType()
99100
return self.mutation
100101
end
101102

103+
function schema:getSubscriptionType()
104+
return self.subscription
105+
end
106+
102107
function schema:getTypeMap()
103108
return self.typeMap
104109
end

0 commit comments

Comments
 (0)