From 6363518c85cbd8247a5f6507b8a1dd3903cfb71d Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Sun, 29 Jul 2018 18:11:33 +0200 Subject: relay connection working with gqlgen --- vendor/github.com/vektah/gqlgen/graphql/oneshot.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 vendor/github.com/vektah/gqlgen/graphql/oneshot.go (limited to 'vendor/github.com/vektah/gqlgen/graphql/oneshot.go') 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 + } +} -- cgit