aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/99designs/gqlgen/handler/mock.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2020-02-05 22:03:19 +0100
committerMichael Muré <batolettre@gmail.com>2020-02-05 22:33:03 +0100
commit1d4bb7ceb0cef79d68df0bacc913b01e40e6ddd6 (patch)
treee088b0fa43058afde1db71541d8fcb4b94905d6e /vendor/github.com/99designs/gqlgen/handler/mock.go
parentf093be96e98284580d61664adecd0a2ff8b354e4 (diff)
downloadgit-bug-1d4bb7ceb0cef79d68df0bacc913b01e40e6ddd6.tar.gz
migrate to go modules
Diffstat (limited to 'vendor/github.com/99designs/gqlgen/handler/mock.go')
-rw-r--r--vendor/github.com/99designs/gqlgen/handler/mock.go57
1 files changed, 0 insertions, 57 deletions
diff --git a/vendor/github.com/99designs/gqlgen/handler/mock.go b/vendor/github.com/99designs/gqlgen/handler/mock.go
deleted file mode 100644
index 3e70cf03..00000000
--- a/vendor/github.com/99designs/gqlgen/handler/mock.go
+++ /dev/null
@@ -1,57 +0,0 @@
-package handler
-
-import (
- "context"
-
- "github.com/99designs/gqlgen/graphql"
- "github.com/vektah/gqlparser"
- "github.com/vektah/gqlparser/ast"
-)
-
-type executableSchemaMock struct {
- MutationFunc func(ctx context.Context, op *ast.OperationDefinition) *graphql.Response
-}
-
-var _ graphql.ExecutableSchema = &executableSchemaMock{}
-
-func (e *executableSchemaMock) Schema() *ast.Schema {
- return gqlparser.MustLoadSchema(&ast.Source{Input: `
- schema { query: Query, mutation: Mutation }
- type Query {
- empty: String!
- }
- scalar Upload
- type File {
- id: Int!
- }
- input UploadFile {
- id: Int!
- file: Upload!
- }
- type Mutation {
- singleUpload(file: Upload!): File!
- singleUploadWithPayload(req: UploadFile!): File!
- multipleUpload(files: [Upload!]!): [File!]!
- multipleUploadWithPayload(req: [UploadFile!]!): [File!]!
- }
- `})
-}
-
-func (e *executableSchemaMock) Complexity(typeName, field string, childComplexity int, args map[string]interface{}) (int, bool) {
- return 0, false
-}
-
-func (e *executableSchemaMock) Query(ctx context.Context, op *ast.OperationDefinition) *graphql.Response {
- return graphql.ErrorResponse(ctx, "queries are not supported")
-}
-
-func (e *executableSchemaMock) Mutation(ctx context.Context, op *ast.OperationDefinition) *graphql.Response {
- return e.MutationFunc(ctx, op)
-}
-
-func (e *executableSchemaMock) Subscription(ctx context.Context, op *ast.OperationDefinition) func() *graphql.Response {
- return func() *graphql.Response {
- <-ctx.Done()
- return nil
- }
-}