github.com/robertoortis/gqlgenm@v0.7.2/graphql/oneshot.go (about)

     1  package graphql
     2  
     3  func OneShot(resp *Response) func() *Response {
     4  	var oneshot bool
     5  
     6  	return func() *Response {
     7  		if oneshot {
     8  			return nil
     9  		}
    10  		oneshot = true
    11  
    12  		return resp
    13  	}
    14  }