github.com/shippio/gqlgen@v0.0.0-20220912092219-633ea699ef07/graphql/oneshot.go (about) 1 package graphql 2 3 import "context" 4 5 func OneShot(resp *Response) ResponseHandler { 6 var oneshot bool 7 8 return func(context context.Context) *Response { 9 if oneshot { 10 return nil 11 } 12 oneshot = true 13 14 return resp 15 } 16 }