diff options
Diffstat (limited to 'vendor/github.com/vektah/gqlgen/graphql/oneshot.go')
-rw-r--r-- | vendor/github.com/vektah/gqlgen/graphql/oneshot.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/vendor/github.com/vektah/gqlgen/graphql/oneshot.go b/vendor/github.com/vektah/gqlgen/graphql/oneshot.go new file mode 100644 index 00000000..dd31f5ba --- /dev/null +++ b/vendor/github.com/vektah/gqlgen/graphql/oneshot.go @@ -0,0 +1,14 @@ +package graphql + +func OneShot(resp *Response) func() *Response { + var oneshot bool + + return func() *Response { + if oneshot { + return nil + } + oneshot = true + + return resp + } +} |