Repository: jensneuse/graphql-go-tools
Pull request #186 (2020-02-25 09:41:17)

Feature/extract execution mapping into config
This PR will extract the mapping logic into a configuration object.
Until now it was necessary to define mappings using GraphQL directives.
With this PR this behaviour is deprecated in favour of a configuration object.
In the future this object will also contain configurations for data sources.


Patch:
diff --git a/pkg/ast/ast.go b/pkg/ast/ast.go
index 32fce773..b80f1f31 100644
--- a/pkg/ast/ast.go
+++ b/pkg/ast/ast.go
@@ -578,7 +578,7 @@ func (d *Document) NodeFieldDefinitionByName(node Node, fieldName ByteSlice) (de
 	return
 }
 
-func (d *Document) NodeTypeNameString(node Node) string {
+func (d *Document) NodeNameString(node Node) string {
 	return unsafebytes.BytesToString(d.NodeNameBytes(node))
 }
 
diff --git a/pkg/execution/datasource.go b/pkg/execution/datasource.go
index 78c1deec..4239fba8 100644
--- a/pkg/execution/datasource.go
+++ b/pkg/execution/datasource.go
@@ -71,11 +71,12 @@ type DataSourcePlanner interface {
 
 type BaseDataSourcePlanner struct {
 	log                   abstractlogger.Logger
-	walker                *astvisitor.Walker // nolint
-	definition, operation *ast.Document      // nolint
-	args                  []Argument         // nolint
-	graphqlDefinitions    *packr.Box         // nolint
-	rootField             rootField          // nolint
+	walker                *astvisitor.Walker   // nolint
+	definition, operation *ast.Document        // nolint
+	args                  []Argument           // nolint
+	graphqlDefinitions    *packr.Box           // nolint
+	rootField             rootField            // nolint
+	config                PlannerConfiguration // nolint
 }
 
 type rootField struct {
@@ -83,7 +84,7 @@ type rootField struct {
 	ref       int
 }
 
-func (r *rootField) setIfNotDefined(ref int){
+func (r *rootField) setIfNotDefined(ref int) {
 	if r.isDefined {
 		return
 	}
@@ -93,4 +94,4 @@ func (r *rootField) setIfNotDefined(ref int){
 
 func (r *rootField) isDefinedAndEquals(ref int) bool {
 	return r.isDefined && r.ref == ref
-}
\ No newline at end of file
+}
diff --git a/pkg/execution/datasource_graphql.go b/pkg/execution/datasource_graphql.go
index 14eb0516..1908f9a4 100644
--- a/pkg/execution/datasource_graphql.go
+++ b/pkg/execution/datasource_graphql.go
@@ -4,12 +4,13 @@ import (
 	"bytes"
 	"encoding/json"
 	"github.com/buger/jsonparser"
+	log "github.com/jensneuse/abstractlogger"
+	"github.com/jensneuse/graphql-go-tools/internal/pkg/unsafebytes"
 	"github.com/jensneuse/graphql-go-tools/pkg/ast"
 	"github.com/jensneuse/graphql-go-tools/pkg/astimport"
 	"github.com/jensneuse/graphql-go-tools/pkg/astprinter"
 	"github.com/jensneuse/graphql-go-tools/pkg/astvisitor"
 	"github.com/jensneuse/graphql-go-tools/pkg/lexer/literal"
-	log "github.com/jensneuse/abstractlogger"
 	"io"
 	"io/ioutil"
 	"net/http"
@@ -68,7 +69,7 @@ func (g *GraphQLDataSourcePlanner) Initialize(walker *astvisitor.Walker, operati
 		})
 		g.rootFieldArgumentRefs[i] = len(g.resolveDocument.Arguments) - 1
 
-		typeRef := g.importer.ImportType(resolverParameters[i].variableType,g.resolveDocument)
+		typeRef := g.importer.ImportType(resolverParameters[i].variableType, g.resolveDocument)
 
 		g.resolveDocument.VariableDefinitions = append(g.resolveDocument.VariableDefinitions, ast.VariableDefinition{
 			VariableValue: variableValue,
@@ -141,12 +142,12 @@ func (g *GraphQLDataSourcePlanner) EnterField(ref int) {
 	if g.rootFieldRef == -1 {
 		g.rootFieldRef = ref
 
-		var fieldName []byte
-		objectName, ok := g.walker.FieldDefinitionDirectiveArgumentValueByName(ref, []byte("mapping"), []byte("pathSelector"))
-		if ok && objectName.Kind == ast.ValueKindString {
-			fieldName = g.definition.StringValueContentBytes(objectName.Ref)
-		} else {
-			fieldName = g.operation.FieldNameBytes(ref)
+		typeName := g.definition.NodeNameString(g.walker.EnclosingTypeDefinition)
+		fieldNameStr := g.operation.FieldNameString(ref)
+		fieldName := g.operation.FieldNameBytes(ref)
+		mapping, ok := g.config.mappingForTypeField(typeName, fieldNameStr)
+		if ok && !mapping.Disabled {
+			fieldName = unsafebytes.StringToBytes(mapping.Path)
 		}
 
 		field := ast.Field{
@@ -310,7 +311,7 @@ func (g *GraphQLDataSource) Resolve(ctx Context, args ResolvedArgs, out io.Write
 		}
 	}
 
-	variablesJson,err := json.Marshal(variables)
+	variablesJson, err := json.Marshal(variables)
 	if err != nil {
 		g.log.Error("GraphQLDataSource.json.Marshal(variables)",
 			log.Error(err),
diff --git a/pkg/execution/handler.go b/pkg/execution/handler.go
index 6b68d77b..536a0bcb 100644
--- a/pkg/execution/handler.go
+++ b/pkg/execution/handler.go
@@ -23,13 +23,14 @@ import (
 )
 
 type Handler struct {
-	log                abstractlogger.Logger
-	definition         ast.Document
-	graphqlDefinitions *packr.Box
-	templateDirectives []byte_template.DirectiveDefinition
+	log                  abstractlogger.Logger
+	definition           ast.Document
+	graphqlDefinitions   *packr.Box
+	templateDirectives   []byte_template.DirectiveDefinition
+	plannerConfiguration PlannerConfiguration
 }
 
-func NewHandler(schema []byte, templateDirectives []byte_template.DirectiveDefinition, logger abstractlogger.Logger) (*Handler, error) {
+func NewHandler(schema []byte, plannerConfiguration PlannerConfiguration, templateDirectives []byte_template.DirectiveDefinition, logger abstractlogger.Logger) (*Handler, error) {
 
 	schema = append(schema, graphqlDefinitionBoilerplate...)
 
@@ -41,10 +42,11 @@ func NewHandler(schema []byte, templateDirectives []byte_template.DirectiveDefin
 	box := packr.NewBox("./graphql_definitions")
 
 	return &Handler{
-		log:                logger,
-		definition:         definition,
-		graphqlDefinitions: &box,
-		templateDirectives: templateDirectives,
+		log:                  logger,
+		definition:           definition,
+		graphqlDefinitions:   &box,
+		templateDirectives:   templateDirectives,
+		plannerConfiguration: plannerConfiguration,
 	}, nil
 }
 
@@ -91,7 +93,7 @@ func (h *Handler) Handle(requestData, extraVariables []byte) (executor *Executor
 
 	variables, extraArguments := h.VariablesFromJson(graphqlRequest.Variables, extraVariables)
 
-	planner := NewPlanner(h.resolverDefinitions(&report))
+	planner := NewPlanner(h.resolverDefinitions(&report), h.plannerConfiguration)
 	if report.HasErrors() {
 		err = report
 		return
@@ -156,6 +158,7 @@ func (h *Handler) resolverDefinitions(report *operationreport.Report) ResolverDe
 	baseDataSourcePlanner := BaseDataSourcePlanner{
 		log:                h.log,
 		graphqlDefinitions: h.graphqlDefinitions,
+		config:             h.plannerConfiguration,
 	}
 
 	definitions := ResolverDefinitions{
diff --git a/pkg/execution/planning.go b/pkg/execution/planning.go
index b17b04db..b861f7c6 100644
--- a/pkg/execution/planning.go
+++ b/pkg/execution/planning.go
@@ -26,6 +26,30 @@ type DataSourceDefinition struct {
 	DataSourcePlannerFactory func() DataSourcePlanner
 }
 
+type TypeFieldConfiguration struct {
+	TypeName  string
+	FieldName string
+	Mapping   MappingConfiguration
+}
+
+type MappingConfiguration struct {
+	Disabled bool
+	Path     string
+}
+
+type PlannerConfiguration struct {
+	TypeFieldConfigurations []TypeFieldConfiguration
+}
+
+func (p PlannerConfiguration) mappingForTypeField(typeName, fieldName string) (config MappingConfiguration, exists bool) {
+	for i := range p.TypeFieldConfigurations {
+		if p.TypeFieldConfigurations[i].TypeName == typeName && p.TypeFieldConfigurations[i].FieldName == fieldName {
+			return p.TypeFieldConfigurations[i].Mapping, true
+		}
+	}
+	return
+}
+
 type ResolverDefinitions []DataSourceDefinition
 
 func (r ResolverDefinitions) DefinitionForTypeField(typeName, fieldName []byte, definition *DataSourceDefinition) (exists bool) {
@@ -38,11 +62,12 @@ func (r ResolverDefinitions) DefinitionForTypeField(typeName, fieldName []byte,
 	return false
 }
 
-func NewPlanner(resolverDefinitions ResolverDefinitions) *Planner {
+func NewPlanner(resolverDefinitions ResolverDefinitions, config PlannerConfiguration) *Planner {
 	walker := astvisitor.NewWalker(48)
 	visitor := planningVisitor{
 		Walker:              &walker,
 		resolverDefinitions: resolverDefinitions,
+		config:              config,
 	}
 
 	walker.RegisterEnterDocumentVisitor(&visitor)
@@ -66,6 +91,7 @@ func (p *Planner) Plan(operation, definition *ast.Document, report *operationrep
 
 type planningVisitor struct {
 	*astvisitor.Walker
+	config                PlannerConfiguration
 	resolverDefinitions   ResolverDefinitions
 	operation, definition *ast.Document
 	rootNode              RootNode
@@ -395,40 +421,17 @@ func (p *planningVisitor) fieldDataResolvingConfig(ref int) DataResolvingConfig
 }
 
 func (p *planningVisitor) fieldPathSelector(ref int) (selector PathSelector) {
-	selector.Path = p.operation.FieldNameString(ref)
-	definition, ok := p.FieldDefinition(ref)
-	switch {
-	case !ok: // field not defined
-		return
-	case selector.Path == "__typename": // __typename field is static
+	fieldName := p.operation.FieldNameString(ref)
+	typeName := p.definition.NodeNameString(p.EnclosingTypeDefinition)
+	mapping, exists := p.config.mappingForTypeField(typeName, fieldName)
+	if !exists {
+		selector.Path = fieldName
 		return
 	}
-	directive, ok := p.definition.FieldDefinitionDirectiveByName(definition, []byte("mapping"))
-	if ok {
-		value, ok := p.definition.DirectiveArgumentValueByName(directive, []byte("mode"))
-		if !ok {
-			def := p.definition.DirectiveArgumentInputValueDefinition([]byte("mapping"), []byte("mode"))
-			if def == -1 {
-				return
-			}
-			ok = p.definition.InputValueDefinitionHasDefaultValue(def)
-			value = p.definition.InputValueDefinitionDefaultValue(def)
-		}
-		if ok && value.Kind == ast.ValueKindEnum {
-			mode := p.definition.EnumValueNameString(value.Ref)
-			switch mode {
-			case "NONE":
-				selector.Path = ""
-				return
-			case "PATH_SELECTOR":
-				value, ok = p.definition.DirectiveArgumentValueByName(directive, []byte("pathSelector"))
-				if ok && value.Kind == ast.ValueKindString {
-					selector.Path = p.definition.StringValueContentString(value.Ref)
-					return
-				}
-			}
-		}
+	if mapping.Disabled {
+		return
 	}
+	selector.Path = mapping.Path
 	return
 }
 


Test patch:
diff --git a/pkg/astvisitor/visitor_test.go b/pkg/astvisitor/visitor_test.go
index 5043f763..bdda2f56 100644
--- a/pkg/astvisitor/visitor_test.go
+++ b/pkg/astvisitor/visitor_test.go
@@ -895,41 +895,41 @@ func (p *printingVisitor) LeaveOperationDefinition(ref int) {
 
 func (p *printingVisitor) EnterSelectionSet(ref int) {
 	p.enter()
-	parentTypeName := p.definition.NodeTypeNameString(p.EnclosingTypeDefinition)
+	parentTypeName := p.definition.NodeNameString(p.EnclosingTypeDefinition)
 	p.must(fmt.Fprintf(p.out, "EnterSelectionSet(%s): ref: %d\n", parentTypeName, ref))
 }
 
 func (p *printingVisitor) LeaveSelectionSet(ref int) {
 	p.leave()
-	parentTypeName := p.definition.NodeTypeNameString(p.EnclosingTypeDefinition)
+	parentTypeName := p.definition.NodeNameString(p.EnclosingTypeDefinition)
 	p.must(fmt.Fprintf(p.out, "LeaveSelectionSet(%s): ref: %d\n", parentTypeName, ref))
 }
 
 func (p *printingVisitor) EnterField(ref int) {
 	p.enter()
 	fieldName := p.operation.FieldNameBytes(ref)
-	parentTypeName := p.definition.NodeTypeNameString(p.EnclosingTypeDefinition)
+	parentTypeName := p.definition.NodeNameString(p.EnclosingTypeDefinition)
 	p.must(fmt.Fprintf(p.out, "EnterField(%s::%s): ref: %d\n", fieldName, parentTypeName, ref))
 }
 
 func (p *printingVisitor) LeaveField(ref int) {
 	p.leave()
 	fieldName := p.operation.FieldNameString(ref)
-	parentTypeName := p.definition.NodeTypeNameString(p.EnclosingTypeDefinition)
+	parentTypeName := p.definition.NodeNameString(p.EnclosingTypeDefinition)
 	p.must(fmt.Fprintf(p.out, "LeaveField(%s::%s): ref: %d\n", fieldName, parentTypeName, ref))
 }
 
 func (p *printingVisitor) EnterArgument(ref int) {
 	p.enter()
 	argName := p.operation.ArgumentNameString(ref)
-	parentTypeName := p.definition.NodeTypeNameString(p.EnclosingTypeDefinition)
+	parentTypeName := p.definition.NodeNameString(p.EnclosingTypeDefinition)
 	p.must(fmt.Fprintf(p.out, "EnterArgument(%s::%s): ref: %d\n", argName, parentTypeName, ref))
 }
 
 func (p *printingVisitor) LeaveArgument(ref int) {
 	p.leave()
 	argName := p.operation.ArgumentNameString(ref)
-	parentTypeName := p.definition.NodeTypeNameString(p.EnclosingTypeDefinition)
+	parentTypeName := p.definition.NodeNameString(p.EnclosingTypeDefinition)
 	p.must(fmt.Fprintf(p.out, "LeaveArgument(%s::%s): ref: %d\n", argName, parentTypeName, ref))
 }
 
diff --git a/pkg/execution/datasource_http_json_test.go b/pkg/execution/datasource_http_json_test.go
index 3798f30d..21af20a9 100644
--- a/pkg/execution/datasource_http_json_test.go
+++ b/pkg/execution/datasource_http_json_test.go
@@ -24,7 +24,6 @@ type Query {
             host: "example.com"
             url: "/"
         )
-		@mapping(mode: NONE)
 	unionType: UnionType
         @HttpJsonDataSource(
             host: "example.com"
@@ -37,7 +36,6 @@ type Query {
 				}
 			]
         )
-		@mapping(mode: NONE)
 	interfaceType: InterfaceType
         @HttpJsonDataSource(
             host: "example.com"
@@ -50,7 +48,6 @@ type Query {
 				}
 			]
         )
-		@mapping(mode: NONE)
 }
 type SimpleType {
 	scalarField: String
@@ -97,6 +94,17 @@ func TestHttpJsonDataSourcePlanner_Plan(t *testing.T) {
 				},
 			},
 		},
+		PlannerConfiguration{
+			TypeFieldConfigurations: []TypeFieldConfiguration{
+				{
+					TypeName:  "Query",
+					FieldName: "simpleType",
+					Mapping: MappingConfiguration{
+						Disabled: true,
+					},
+				},
+			},
+		},
 		&Object{
 			operationType: ast.OperationTypeQuery,
 			Fields: []Field{
@@ -142,7 +150,7 @@ func TestHttpJsonDataSourcePlanner_Plan(t *testing.T) {
 														Path: "__typename",
 													},
 												},
-												ValueType:StringValueType,
+												ValueType: StringValueType,
 											},
 										},
 										{
@@ -153,7 +161,7 @@ func TestHttpJsonDataSourcePlanner_Plan(t *testing.T) {
 														Path: "scalarField",
 													},
 												},
-												ValueType:StringValueType,
+												ValueType: StringValueType,
 											},
 										},
 									},
@@ -187,6 +195,17 @@ func TestHttpJsonDataSourcePlanner_Plan(t *testing.T) {
 				},
 			},
 		},
+		PlannerConfiguration{
+			TypeFieldConfigurations: []TypeFieldConfiguration{
+				{
+					TypeName:  "Query",
+					FieldName: "unionType",
+					Mapping: MappingConfiguration{
+						Disabled: true,
+					},
+				},
+			},
+		},
 		&Object{
 			operationType: ast.OperationTypeQuery,
 			Fields: []Field{
@@ -232,7 +251,7 @@ func TestHttpJsonDataSourcePlanner_Plan(t *testing.T) {
 														Path: "__typename",
 													},
 												},
-												ValueType:StringValueType,
+												ValueType: StringValueType,
 											},
 										},
 										{
@@ -253,7 +272,7 @@ func TestHttpJsonDataSourcePlanner_Plan(t *testing.T) {
 														Path: "result",
 													},
 												},
-												ValueType:StringValueType,
+												ValueType: StringValueType,
 											},
 										},
 										{
@@ -274,7 +293,7 @@ func TestHttpJsonDataSourcePlanner_Plan(t *testing.T) {
 														Path: "message",
 													},
 												},
-												ValueType:StringValueType,
+												ValueType: StringValueType,
 											},
 										},
 									},
@@ -309,6 +328,17 @@ func TestHttpJsonDataSourcePlanner_Plan(t *testing.T) {
 				},
 			},
 		},
+		PlannerConfiguration{
+			TypeFieldConfigurations: []TypeFieldConfiguration{
+				{
+					TypeName:  "Query",
+					FieldName: "interfaceType",
+					Mapping: MappingConfiguration{
+						Disabled: true,
+					},
+				},
+			},
+		},
 		&Object{
 			operationType: ast.OperationTypeQuery,
 			Fields: []Field{
@@ -354,7 +384,7 @@ func TestHttpJsonDataSourcePlanner_Plan(t *testing.T) {
 														Path: "__typename",
 													},
 												},
-												ValueType:StringValueType,
+												ValueType: StringValueType,
 											},
 										},
 										{
@@ -365,7 +395,7 @@ func TestHttpJsonDataSourcePlanner_Plan(t *testing.T) {
 														Path: "name",
 													},
 												},
-												ValueType:StringValueType,
+												ValueType: StringValueType,
 											},
 										},
 										{
@@ -386,7 +416,7 @@ func TestHttpJsonDataSourcePlanner_Plan(t *testing.T) {
 														Path: "successField",
 													},
 												},
-												ValueType:StringValueType,
+												ValueType: StringValueType,
 											},
 										},
 										{
@@ -407,7 +437,7 @@ func TestHttpJsonDataSourcePlanner_Plan(t *testing.T) {
 														Path: "errorField",
 													},
 												},
-												ValueType:StringValueType,
+												ValueType: StringValueType,
 											},
 										},
 									},
@@ -494,11 +524,6 @@ input StatusCodeTypeNameMapping {
     typeName: String!
 }
 
-directive @mapping(
-    mode: MAPPING_MODE! = PATH_SELECTOR
-    pathSelector: String
-) on FIELD_DEFINITION
-
 enum MAPPING_MODE {
     NONE
     PATH_SELECTOR
diff --git a/pkg/execution/execution_test.go b/pkg/execution/execution_test.go
index f54c5269..c69558a4 100644
--- a/pkg/execution/execution_test.go
+++ b/pkg/execution/execution_test.go
@@ -2819,7 +2819,7 @@ func TestExecutor_Introspection(t *testing.T) {
 		}
 	`)
 
-	handler, err := NewHandler(schema, nil, log.NoopLogger)
+	handler, err := NewHandler(schema, PlannerConfiguration{},nil, log.NoopLogger)
 	if err != nil {
 		t.Fatal(err)
 	}
diff --git a/pkg/execution/handler_test.go b/pkg/execution/handler_test.go
index 8515529b..4e16e93d 100644
--- a/pkg/execution/handler_test.go
+++ b/pkg/execution/handler_test.go
@@ -11,7 +11,7 @@ import (
 )
 
 func TestHandler_RenderGraphQLDefinitions(t *testing.T) {
-	handler, err := NewHandler(nil, nil, log.NoopLogger)
+	handler, err := NewHandler(nil, PlannerConfiguration{}, nil, log.NoopLogger)
 	if err != nil {
 		t.Fatal(err)
 	}
@@ -45,7 +45,7 @@ func TestHandler_RenderGraphQLDefinitions(t *testing.T) {
 }
 
 func TestHandler_VariablesFromRequest(t *testing.T) {
-	handler, err := NewHandler(nil, nil, log.NoopLogger)
+	handler, err := NewHandler(nil, PlannerConfiguration{}, nil, log.NoopLogger)
 	if err != nil {
 		t.Fatal(err)
 	}
diff --git a/pkg/execution/planning_test.go b/pkg/execution/planning_test.go
index 0055b9da..e5c358e3 100644
--- a/pkg/execution/planning_test.go
+++ b/pkg/execution/planning_test.go
@@ -23,7 +23,7 @@ func init() {
 	rand.Seed(time.Now().Unix())
 }
 
-func run(definition string, operation string, resolverDefinitions ResolverDefinitions, want Node) func(t *testing.T) {
+func run(definition string, operation string, resolverDefinitions ResolverDefinitions, config PlannerConfiguration, want Node) func(t *testing.T) {
 	return func(t *testing.T) {
 		def := unsafeparser.ParseGraphqlDocumentString(definition)
 		op := unsafeparser.ParseGraphqlDocumentString(operation)
@@ -35,7 +35,7 @@ func run(definition string, operation string, resolverDefinitions ResolverDefini
 			t.Error(report)
 		}
 
-		planner := NewPlanner(resolverDefinitions)
+		planner := NewPlanner(resolverDefinitions, config)
 		got := planner.Plan(&op, &def, &report)
 		if report.HasErrors() {
 			t.Error(report)
@@ -69,6 +69,9 @@ func TestPlanner_Plan(t *testing.T) {
 				},
 			},
 		},
+		PlannerConfiguration{
+			TypeFieldConfigurations: []TypeFieldConfiguration{},
+		},
 		&Object{
 			operationType: ast.OperationTypeQuery,
 			Fields: []Field{
@@ -118,7 +121,7 @@ func TestPlanner_Plan(t *testing.T) {
 														Path: "code",
 													},
 												},
-												ValueType:StringValueType,
+												ValueType: StringValueType,
 											},
 										},
 										{
@@ -129,7 +132,7 @@ func TestPlanner_Plan(t *testing.T) {
 														Path: "name",
 													},
 												},
-												ValueType:StringValueType,
+												ValueType: StringValueType,
 											},
 										},
 										{
@@ -140,7 +143,7 @@ func TestPlanner_Plan(t *testing.T) {
 														Path: "native",
 													},
 												},
-												ValueType:StringValueType,
+												ValueType: StringValueType,
 											},
 										},
 									},
@@ -169,6 +172,9 @@ func TestPlanner_Plan(t *testing.T) {
 				},
 			},
 		},
+		PlannerConfiguration{
+			TypeFieldConfigurations: []TypeFieldConfiguration{},
+		},
 		&Object{
 			operationType: ast.OperationTypeMutation,
 			Fields: []Field{
@@ -218,7 +224,7 @@ func TestPlanner_Plan(t *testing.T) {
 														Path: "id",
 													},
 												},
-												ValueType:StringValueType,
+												ValueType: StringValueType,
 											},
 										},
 										{
@@ -229,7 +235,7 @@ func TestPlanner_Plan(t *testing.T) {
 														Path: "likes",
 													},
 												},
-												ValueType:IntegerValueType,
+												ValueType: IntegerValueType,
 											},
 										},
 									},
@@ -280,6 +286,45 @@ func TestPlanner_Plan(t *testing.T) {
 				},
 			},
 		},
+		PlannerConfiguration{
+			TypeFieldConfigurations: []TypeFieldConfiguration{
+				{
+					TypeName:  "JSONPlaceholderPost",
+					FieldName: "comments",
+					Mapping: MappingConfiguration{
+						Disabled: true,
+					},
+				},
+				{
+					TypeName:  "Query",
+					FieldName: "httpBinGet",
+					Mapping: MappingConfiguration{
+						Disabled: true,
+					},
+				},
+				{
+					TypeName:  "Query",
+					FieldName: "post",
+					Mapping: MappingConfiguration{
+						Disabled: true,
+					},
+				},
+				{
+					TypeName:  "HttpBinGet",
+					FieldName: "header",
+					Mapping: MappingConfiguration{
+						Path: "headers",
+					},
+				},
+				{
+					TypeName:  "Headers",
+					FieldName: "acceptEncoding",
+					Mapping: MappingConfiguration{
+						Path: "Accept-Encoding",
+					},
+				},
+			},
+		},
 		&Object{
 			operationType: ast.OperationTypeQuery,
 			Fields: []Field{
@@ -365,7 +410,7 @@ func TestPlanner_Plan(t *testing.T) {
 																	Path: "Accept",
 																},
 															},
-															ValueType:StringValueType,
+															ValueType: StringValueType,
 														},
 													},
 													{
@@ -376,7 +421,7 @@ func TestPlanner_Plan(t *testing.T) {
 																	Path: "Host",
 																},
 															},
-															ValueType:StringValueType,
+															ValueType: StringValueType,
 														},
 													},
 													{
@@ -387,7 +432,7 @@ func TestPlanner_Plan(t *testing.T) {
 																	Path: "Accept-Encoding",
 																},
 															},
-															ValueType:StringValueType,
+															ValueType: StringValueType,
 														},
 													},
 												},
@@ -439,7 +484,7 @@ func TestPlanner_Plan(t *testing.T) {
 														Path: "id",
 													},
 												},
-												ValueType:IntegerValueType,
+												ValueType: IntegerValueType,
 											},
 										},
 										{
@@ -456,7 +501,7 @@ func TestPlanner_Plan(t *testing.T) {
 																		Path: "id",
 																	},
 																},
-																ValueType:IntegerValueType,
+																ValueType: IntegerValueType,
 															},
 														},
 													},
@@ -486,6 +531,17 @@ func TestPlanner_Plan(t *testing.T) {
 				},
 			},
 		},
+		PlannerConfiguration{
+			TypeFieldConfigurations: []TypeFieldConfiguration{
+				{
+					TypeName:  "Query",
+					FieldName: "withBody",
+					Mapping: MappingConfiguration{
+						Disabled: true,
+					},
+				},
+			},
+		},
 		&Object{
 			operationType: ast.OperationTypeQuery,
 			Fields: []Field{
@@ -525,7 +581,7 @@ func TestPlanner_Plan(t *testing.T) {
 								Name:            []byte("withBody"),
 								HasResolvedData: true,
 								Value: &Value{
-									ValueType:StringValueType,
+									ValueType: StringValueType,
 								},
 							},
 						},
@@ -547,6 +603,17 @@ func TestPlanner_Plan(t *testing.T) {
 				},
 			},
 		},
+		PlannerConfiguration{
+			TypeFieldConfigurations: []TypeFieldConfiguration{
+				{
+					TypeName:  "Query",
+					FieldName: "withPath",
+					Mapping: MappingConfiguration{
+						Path: "subObject",
+					},
+				},
+			},
+		},
 		&Object{
 			operationType: ast.OperationTypeQuery,
 			Fields: []Field{
@@ -583,7 +650,7 @@ func TestPlanner_Plan(t *testing.T) {
 											Path: "subObject",
 										},
 									},
-									ValueType:StringValueType,
+									ValueType: StringValueType,
 								},
 							},
 						},
@@ -607,6 +674,17 @@ func TestPlanner_Plan(t *testing.T) {
 				},
 			},
 		},
+		PlannerConfiguration{
+			TypeFieldConfigurations: []TypeFieldConfiguration{
+				{
+					TypeName:  "Query",
+					FieldName: "listItems",
+					Mapping: MappingConfiguration{
+						Disabled: true,
+					},
+				},
+			},
+		},
 		&Object{
 			operationType: ast.OperationTypeQuery,
 			Fields: []Field{
@@ -652,7 +730,7 @@ func TestPlanner_Plan(t *testing.T) {
 															Path: "id",
 														},
 													},
-													ValueType:StringValueType,
+													ValueType: StringValueType,
 												},
 											},
 										},
@@ -680,6 +758,17 @@ func TestPlanner_Plan(t *testing.T) {
 				},
 			},
 		},
+		PlannerConfiguration{
+			TypeFieldConfigurations: []TypeFieldConfiguration{
+				{
+					TypeName:  "Query",
+					FieldName: "listWithPath",
+					Mapping: MappingConfiguration{
+						Path: "items",
+					},
+				},
+			},
+		},
 		&Object{
 			operationType: ast.OperationTypeQuery,
 			Fields: []Field{
@@ -730,7 +819,7 @@ func TestPlanner_Plan(t *testing.T) {
 															Path: "id",
 														},
 													},
-													ValueType:StringValueType,
+													ValueType: StringValueType,
 												},
 											},
 										},
@@ -756,6 +845,17 @@ func TestPlanner_Plan(t *testing.T) {
 				},
 			},
 		},
+		PlannerConfiguration{
+			TypeFieldConfigurations: []TypeFieldConfiguration{
+				{
+					TypeName:  "Query",
+					FieldName: "withHeaders",
+					Mapping: MappingConfiguration{
+						Disabled: true,
+					},
+				},
+			},
+		},
 		&Object{
 			operationType: ast.OperationTypeQuery,
 			Fields: []Field{
@@ -800,7 +900,7 @@ func TestPlanner_Plan(t *testing.T) {
 								Name:            []byte("withHeaders"),
 								HasResolvedData: true,
 								Value: &Value{
-									ValueType:StringValueType,
+									ValueType: StringValueType,
 								},
 							},
 						},
@@ -839,6 +939,31 @@ func TestPlanner_Plan(t *testing.T) {
 				},
 			},
 		},
+		PlannerConfiguration{
+			TypeFieldConfigurations: []TypeFieldConfiguration{
+				{
+					TypeName:  "Query",
+					FieldName: "hello",
+					Mapping: MappingConfiguration{
+						Disabled: true,
+					},
+				},
+				{
+					TypeName:  "Query",
+					FieldName: "foo",
+					Mapping: MappingConfiguration{
+						Disabled: true,
+					},
+				},
+				{
+					TypeName:  "Query",
+					FieldName: "nullableInt",
+					Mapping: MappingConfiguration{
+						Disabled: true,
+					},
+				},
+			},
+		},
 		&Object{
 			operationType: ast.OperationTypeQuery,
 			Fields: []Field{
@@ -887,14 +1012,14 @@ func TestPlanner_Plan(t *testing.T) {
 								Name:            []byte("hello"),
 								HasResolvedData: true,
 								Value: &Value{
-									ValueType:StringValueType,
+									ValueType: StringValueType,
 								},
 							},
 							{
 								Name:            []byte("nullableInt"),
 								HasResolvedData: true,
 								Value: &Value{
-									ValueType:IntegerValueType,
+									ValueType: IntegerValueType,
 								},
 							},
 							{
@@ -910,7 +1035,7 @@ func TestPlanner_Plan(t *testing.T) {
 														Path: "bar",
 													},
 												},
-												ValueType:StringValueType,
+												ValueType: StringValueType,
 											},
 										},
 									},
@@ -934,93 +1059,99 @@ func TestPlanner_Plan(t *testing.T) {
 						}
 					}
 				}
-`, ResolverDefinitions{
-		{
-			TypeName:  literal.QUERY,
-			FieldName: literal.UNDERSCORETYPE,
-			DataSourcePlannerFactory: func() DataSourcePlanner {
-				return &TypeDataSourcePlanner{}
+`,
+		ResolverDefinitions{
+			{
+				TypeName:  literal.QUERY,
+				FieldName: literal.UNDERSCORETYPE,
+				DataSourcePlannerFactory: func() DataSourcePlanner {
+					return &TypeDataSourcePlanner{}
+				},
 			},
 		},
-	}, &Object{
-		operationType: ast.OperationTypeQuery,
-		Fields: []Field{
-			{
-				Name: []byte("data"),
-				Value: &Object{
-					Fetch: &SingleFetch{
-						Source: &DataSourceInvocation{
-							Args: []Argument{
-								&ContextVariableArgument{
-									Name:         []byte("name"),
-									VariableName: []byte("name"),
+		PlannerConfiguration{
+			TypeFieldConfigurations: []TypeFieldConfiguration{},
+		},
+		&Object{
+			operationType: ast.OperationTypeQuery,
+			Fields: []Field{
+				{
+					Name: []byte("data"),
+					Value: &Object{
+						Fetch: &SingleFetch{
+							Source: &DataSourceInvocation{
+								Args: []Argument{
+									&ContextVariableArgument{
+										Name:         []byte("name"),
+										VariableName: []byte("name"),
+									},
 								},
+								DataSource: &TypeDataSource{},
 							},
-							DataSource: &TypeDataSource{},
+							BufferName: "__type",
 						},
-						BufferName: "__type",
-					},
-					Fields: []Field{
-						{
-							Name:            []byte("__type"),
-							HasResolvedData: true,
-							Value: &Object{
-								DataResolvingConfig: DataResolvingConfig{
-									PathSelector: PathSelector{
-										Path: "__type",
+						Fields: []Field{
+							{
+								Name:            []byte("__type"),
+								HasResolvedData: true,
+								Value: &Object{
+									DataResolvingConfig: DataResolvingConfig{
+										PathSelector: PathSelector{
+											Path: "__type",
+										},
 									},
-								},
-								Fields: []Field{
-									{
-										Name: []byte("name"),
-										Value: &Value{
-											DataResolvingConfig: DataResolvingConfig{
-												PathSelector: PathSelector{
-													Path: "name",
+									Fields: []Field{
+										{
+											Name: []byte("name"),
+											Value: &Value{
+												DataResolvingConfig: DataResolvingConfig{
+													PathSelector: PathSelector{
+														Path: "name",
+													},
 												},
+												ValueType: StringValueType,
 											},
-											ValueType:StringValueType,
 										},
-									},
-									{
-										Name: []byte("fields"),
-										Value: &List{
-											DataResolvingConfig: DataResolvingConfig{
-												PathSelector: PathSelector{
-													Path: "fields",
+										{
+											Name: []byte("fields"),
+											Value: &List{
+												DataResolvingConfig: DataResolvingConfig{
+													PathSelector: PathSelector{
+														Path: "fields",
+													},
 												},
-											},
-											Value: &Object{
-												Fields: []Field{
-													{
-														Name: []byte("name"),
-														Value: &Value{
-															DataResolvingConfig: DataResolvingConfig{
-																PathSelector: PathSelector{
-																	Path: "name",
+												Value: &Object{
+													Fields: []Field{
+														{
+															Name: []byte("name"),
+															Value: &Value{
+																DataResolvingConfig: DataResolvingConfig{
+																	PathSelector: PathSelector{
+																		Path: "name",
+																	},
 																},
+																ValueType: StringValueType,
 															},
-															ValueType:StringValueType,
 														},
-													},
-													{
-														Name: []byte("type"),
-														Value: &Object{
-															DataResolvingConfig: DataResolvingConfig{
-																PathSelector: PathSelector{
-																	Path: "type",
+														{
+															Name: []byte("type"),
+															Value: &Object{
+																DataResolvingConfig: DataResolvingConfig{
+																	PathSelector: PathSelector{
+																		Path: "type",
+																	},
 																},
-															},
-															Fields: []Field{
-																{
-																	Name: []byte("name"),
-																	Value: &Value{
-																		DataResolvingConfig: DataResolvingConfig{
-																			PathSelector: PathSelector{
-																				Path: "name",
+																Fields: []Field{
+																	{
+																		Name: []byte("name"),
+																		Value: &Value{
+																			DataResolvingConfig: DataResolvingConfig{
+																				PathSelector: PathSelector{
+																					Path: "name",
+																				},
 																			},
+																			ValueType: StringValueType,
 																		},
-																		ValueType:StringValueType,
 																	},
 																},
 															},
@@ -1036,8 +1167,7 @@ func TestPlanner_Plan(t *testing.T) {
 					},
 				},
 			},
-		},
-	}))
+		}))
 	t.Run("graphql resolver", run(withBaseSchema(complexSchema), `
 			query UserQuery($id: String!) {
 				user(id: $id) {
@@ -1055,6 +1185,9 @@ func TestPlanner_Plan(t *testing.T) {
 				},
 			},
 		},
+		PlannerConfiguration{
+			TypeFieldConfigurations: []TypeFieldConfiguration{},
+		},
 		&Object{
 			operationType: ast.OperationTypeQuery,
 			Fields: []Field{
@@ -1104,7 +1237,7 @@ func TestPlanner_Plan(t *testing.T) {
 														Path: "id",
 													},
 												},
-												ValueType:StringValueType,
+												ValueType: StringValueType,
 											},
 										},
 										{
@@ -1115,7 +1248,7 @@ func TestPlanner_Plan(t *testing.T) {
 														Path: "name",
 													},
 												},
-												ValueType:StringValueType,
+												ValueType: StringValueType,
 											},
 										},
 										{
@@ -1126,7 +1259,7 @@ func TestPlanner_Plan(t *testing.T) {
 														Path: "birthday",
 													},
 												},
-												ValueType:StringValueType,
+												ValueType: StringValueType,
 											},
 										},
 									},
@@ -1154,6 +1287,17 @@ func TestPlanner_Plan(t *testing.T) {
 				},
 			},
 		},
+		PlannerConfiguration{
+			TypeFieldConfigurations: []TypeFieldConfiguration{
+				{
+					TypeName:  "Query",
+					FieldName: "restUser",
+					Mapping: MappingConfiguration{
+						Disabled: true,
+					},
+				},
+			},
+		},
 		&Object{
 			operationType: ast.OperationTypeQuery,
 			Fields: []Field{
@@ -1202,7 +1346,7 @@ func TestPlanner_Plan(t *testing.T) {
 														Path: "id",
 													},
 												},
-												ValueType:StringValueType,
+												ValueType: StringValueType,
 											},
 										},
 										{
@@ -1213,7 +1357,7 @@ func TestPlanner_Plan(t *testing.T) {
 														Path: "name",
 													},
 												},
-												ValueType:StringValueType,
+												ValueType: StringValueType,
 											},
 										},
 										{
@@ -1224,7 +1368,7 @@ func TestPlanner_Plan(t *testing.T) {
 														Path: "birthday",
 													},
 												},
-												ValueType:StringValueType,
+												ValueType: StringValueType,
 											},
 										},
 									},
@@ -1265,6 +1409,17 @@ func TestPlanner_Plan(t *testing.T) {
 				},
 			},
 		},
+		PlannerConfiguration{
+			TypeFieldConfigurations: []TypeFieldConfiguration{
+				{
+					TypeName:  "User",
+					FieldName: "friends",
+					Mapping: MappingConfiguration{
+						Disabled: true,
+					},
+				},
+			},
+		},
 		&Object{
 			operationType: ast.OperationTypeQuery,
 			Fields: []Field{
@@ -1344,7 +1499,7 @@ func TestPlanner_Plan(t *testing.T) {
 														Path: "id",
 													},
 												},
-												ValueType:StringValueType,
+												ValueType: StringValueType,
 											},
 										},
 										{
@@ -1355,7 +1510,7 @@ func TestPlanner_Plan(t *testing.T) {
 														Path: "name",
 													},
 												},
-												ValueType:StringValueType,
+												ValueType: StringValueType,
 											},
 										},
 										{
@@ -1366,7 +1521,7 @@ func TestPlanner_Plan(t *testing.T) {
 														Path: "birthday",
 													},
 												},
-												ValueType:StringValueType,
+												ValueType: StringValueType,
 											},
 										},
 										{
@@ -1383,7 +1538,7 @@ func TestPlanner_Plan(t *testing.T) {
 																		Path: "id",
 																	},
 																},
-																ValueType:StringValueType,
+																ValueType: StringValueType,
 															},
 														},
 														{
@@ -1394,7 +1549,7 @@ func TestPlanner_Plan(t *testing.T) {
 																		Path: "name",
 																	},
 																},
-																ValueType:StringValueType,
+																ValueType: StringValueType,
 															},
 														},
 														{
@@ -1405,7 +1560,7 @@ func TestPlanner_Plan(t *testing.T) {
 																		Path: "birthday",
 																	},
 																},
-																ValueType:StringValueType,
+																ValueType: StringValueType,
 															},
 														},
 													},
@@ -1476,7 +1631,37 @@ func TestPlanner_Plan(t *testing.T) {
 				TypeName:  []byte("User"),
 				FieldName: []byte("pets"),
 				DataSourcePlannerFactory: func() DataSourcePlanner {
-					return NewGraphQLDataSourcePlanner(BaseDataSourcePlanner{})
+					return NewGraphQLDataSourcePlanner(BaseDataSourcePlanner{
+						config: PlannerConfiguration{
+							TypeFieldConfigurations: []TypeFieldConfiguration{
+								{
+									TypeName:  "User",
+									FieldName: "pets",
+									Mapping: MappingConfiguration{
+										Path: "userPets",
+									},
+								},
+							},
+						},
+					})
+				},
+			},
+		},
+		PlannerConfiguration{
+			TypeFieldConfigurations: []TypeFieldConfiguration{
+				{
+					TypeName:  "User",
+					FieldName: "friends",
+					Mapping: MappingConfiguration{
+						Disabled: true,
+					},
+				},
+				{
+					TypeName:  "User",
+					FieldName: "pets",
+					Mapping: MappingConfiguration{
+						Path: "userPets",
+					},
 				},
 			},
 		},
@@ -1589,7 +1774,7 @@ func TestPlanner_Plan(t *testing.T) {
 														Path: "id",
 													},
 												},
-												ValueType:StringValueType,
+												ValueType: StringValueType,
 											},
 										},
 										{
@@ -1600,7 +1785,7 @@ func TestPlanner_Plan(t *testing.T) {
 														Path: "name",
 													},
 												},
-												ValueType:StringValueType,
+												ValueType: StringValueType,
 											},
 										},
 										{
@@ -1643,7 +1828,7 @@ func TestPlanner_Plan(t *testing.T) {
 																		Path: "id",
 																	},
 																},
-																ValueType:StringValueType,
+																ValueType: StringValueType,
 															},
 														},
 														{
@@ -1654,7 +1839,7 @@ func TestPlanner_Plan(t *testing.T) {
 																		Path: "name",
 																	},
 																},
-																ValueType:StringValueType,
+																ValueType: StringValueType,
 															},
 														},
 														{
@@ -1665,7 +1850,7 @@ func TestPlanner_Plan(t *testing.T) {
 																		Path: "birthday",
 																	},
 																},
-																ValueType:StringValueType,
+																ValueType: StringValueType,
 															},
 														},
 														{
@@ -1687,7 +1872,7 @@ func TestPlanner_Plan(t *testing.T) {
 																						Path: "__typename",
 																					},
 																				},
-																				ValueType:StringValueType,
+																				ValueType: StringValueType,
 																			},
 																		},
 																		{
@@ -1698,7 +1883,7 @@ func TestPlanner_Plan(t *testing.T) {
 																						Path: "nickname",
 																					},
 																				},
-																				ValueType:StringValueType,
+																				ValueType: StringValueType,
 																			},
 																		},
 																		{
@@ -1709,7 +1894,7 @@ func TestPlanner_Plan(t *testing.T) {
 																						Path: "name",
 																					},
 																				},
-																				ValueType:StringValueType,
+																				ValueType: StringValueType,
 																			},
 																			Skip: &IfNotEqual{
 																				Left: &ObjectVariableArgument{
@@ -1730,7 +1915,7 @@ func TestPlanner_Plan(t *testing.T) {
 																						Path: "woof",
 																					},
 																				},
-																				ValueType:StringValueType,
+																				ValueType: StringValueType,
 																			},
 																			Skip: &IfNotEqual{
 																				Left: &ObjectVariableArgument{
@@ -1751,7 +1936,7 @@ func TestPlanner_Plan(t *testing.T) {
 																						Path: "name",
 																					},
 																				},
-																				ValueType:StringValueType,
+																				ValueType: StringValueType,
 																			},
 																			Skip: &IfNotEqual{
 																				Left: &ObjectVariableArgument{
@@ -1772,7 +1957,7 @@ func TestPlanner_Plan(t *testing.T) {
 																						Path: "meow",
 																					},
 																				},
-																				ValueType:StringValueType,
+																				ValueType: StringValueType,
 																			},
 																			Skip: &IfNotEqual{
 																				Left: &ObjectVariableArgument{
@@ -1812,7 +1997,7 @@ func TestPlanner_Plan(t *testing.T) {
 																		Path: "__typename",
 																	},
 																},
-																ValueType:StringValueType,
+																ValueType: StringValueType,
 															},
 														},
 														{
@@ -1823,7 +2008,7 @@ func TestPlanner_Plan(t *testing.T) {
 																		Path: "nickname",
 																	},
 																},
-																ValueType:StringValueType,
+																ValueType: StringValueType,
 															},
 														},
 														{
@@ -1834,7 +2019,7 @@ func TestPlanner_Plan(t *testing.T) {
 																		Path: "name",
 																	},
 																},
-																ValueType:StringValueType,
+																ValueType: StringValueType,
 															},
 															Skip: &IfNotEqual{
 																Left: &ObjectVariableArgument{
@@ -1855,7 +2040,7 @@ func TestPlanner_Plan(t *testing.T) {
 																		Path: "woof",
 																	},
 																},
-																ValueType:StringValueType,
+																ValueType: StringValueType,
 															},
 															Skip: &IfNotEqual{
 																Left: &ObjectVariableArgument{
@@ -1876,7 +2061,7 @@ func TestPlanner_Plan(t *testing.T) {
 																		Path: "name",
 																	},
 																},
-																ValueType:StringValueType,
+																ValueType: StringValueType,
 															},
 															Skip: &IfNotEqual{
 																Left: &ObjectVariableArgument{
@@ -1897,7 +2082,7 @@ func TestPlanner_Plan(t *testing.T) {
 																		Path: "meow",
 																	},
 																},
-																ValueType:StringValueType,
+																ValueType: StringValueType,
 															},
 															Skip: &IfNotEqual{
 																Left: &ObjectVariableArgument{
@@ -1922,7 +2107,7 @@ func TestPlanner_Plan(t *testing.T) {
 														Path: "birthday",
 													},
 												},
-												ValueType:StringValueType,
+												ValueType: StringValueType,
 											},
 										},
 									},
@@ -2042,6 +2227,9 @@ func TestPlanner_Plan(t *testing.T) {
 				},
 			},
 		},
+		PlannerConfiguration{
+			TypeFieldConfigurations: []TypeFieldConfiguration{},
+		},
 		&Object{
 			operationType: ast.OperationTypeQuery,
 			Fields: []Field{
@@ -2082,7 +2270,7 @@ func TestPlanner_Plan(t *testing.T) {
 																	Path: "name",
 																},
 															},
-															ValueType:StringValueType,
+															ValueType: StringValueType,
 														},
 													},
 												},
@@ -2105,7 +2293,7 @@ func TestPlanner_Plan(t *testing.T) {
 																	Path: "name",
 																},
 															},
-															ValueType:StringValueType,
+															ValueType: StringValueType,
 														},
 													},
 												},
@@ -2128,7 +2316,7 @@ func TestPlanner_Plan(t *testing.T) {
 																	Path: "name",
 																},
 															},
-															ValueType:StringValueType,
+															ValueType: StringValueType,
 														},
 													},
 												},
@@ -2152,7 +2340,7 @@ func TestPlanner_Plan(t *testing.T) {
 																		Path: "kind",
 																	},
 																},
-																ValueType:StringValueType,
+																ValueType: StringValueType,
 															},
 														},
 														{
@@ -2163,7 +2351,7 @@ func TestPlanner_Plan(t *testing.T) {
 																		Path: "name",
 																	},
 																},
-																ValueType:StringValueType,
+																ValueType: StringValueType,
 															},
 														},
 														{
@@ -2174,7 +2362,7 @@ func TestPlanner_Plan(t *testing.T) {
 																		Path: "description",
 																	},
 																},
-																ValueType:StringValueType,
+																ValueType: StringValueType,
 															},
 														},
 														{
@@ -2195,7 +2383,7 @@ func TestPlanner_Plan(t *testing.T) {
 																						Path: "name",
 																					},
 																				},
-																				ValueType:StringValueType,
+																				ValueType: StringValueType,
 																			},
 																		},
 																		{
@@ -2206,7 +2394,7 @@ func TestPlanner_Plan(t *testing.T) {
 																						Path: "description",
 																					},
 																				},
-																				ValueType:StringValueType,
+																				ValueType: StringValueType,
 																			},
 																		},
 																		{
@@ -2227,7 +2415,7 @@ func TestPlanner_Plan(t *testing.T) {
 																										Path: "name",
 																									},
 																								},
-																								ValueType:StringValueType,
+																								ValueType: StringValueType,
 																							},
 																						},
 																						{
@@ -2238,7 +2426,7 @@ func TestPlanner_Plan(t *testing.T) {
 																										Path: "description",
 																									},
 																								},
-																								ValueType:StringValueType,
+																								ValueType: StringValueType,
 																							},
 																						},
 																						{
@@ -2260,7 +2448,7 @@ func TestPlanner_Plan(t *testing.T) {
 																										Path: "defaultValue",
 																									},
 																								},
-																								ValueType:StringValueType,
+																								ValueType: StringValueType,
 																							},
 																						},
 																					},
@@ -2286,7 +2474,7 @@ func TestPlanner_Plan(t *testing.T) {
 																						Path: "isDeprecated",
 																					},
 																				},
-																				ValueType:BooleanValueType,
+																				ValueType: BooleanValueType,
 																			},
 																		},
 																		{
@@ -2297,7 +2485,7 @@ func TestPlanner_Plan(t *testing.T) {
 																						Path: "deprecationReason",
 																					},
 																				},
-																				ValueType:StringValueType,
+																				ValueType: StringValueType,
 																			},
 																		},
 																	},
@@ -2322,7 +2510,7 @@ func TestPlanner_Plan(t *testing.T) {
 																						Path: "name",
 																					},
 																				},
-																				ValueType:StringValueType,
+																				ValueType: StringValueType,
 																			},
 																		},
 																		{
@@ -2333,7 +2521,7 @@ func TestPlanner_Plan(t *testing.T) {
 																						Path: "description",
 																					},
 																				},
-																				ValueType:StringValueType,
+																				ValueType: StringValueType,
 																			},
 																		},
 																		{
@@ -2355,7 +2543,7 @@ func TestPlanner_Plan(t *testing.T) {
 																						Path: "defaultValue",
 																					},
 																				},
-																				ValueType:StringValueType,
+																				ValueType: StringValueType,
 																			},
 																		},
 																	},
@@ -2393,7 +2581,7 @@ func TestPlanner_Plan(t *testing.T) {
 																						Path: "name",
 																					},
 																				},
-																				ValueType:StringValueType,
+																				ValueType: StringValueType,
 																			},
 																		},
 																		{
@@ -2404,7 +2592,7 @@ func TestPlanner_Plan(t *testing.T) {
 																						Path: "description",
 																					},
 																				},
-																				ValueType:StringValueType,
+																				ValueType: StringValueType,
 																			},
 																		},
 																		{
@@ -2415,7 +2603,7 @@ func TestPlanner_Plan(t *testing.T) {
 																						Path: "isDeprecated",
 																					},
 																				},
-																				ValueType:BooleanValueType,
+																				ValueType: BooleanValueType,
 																			},
 																		},
 																		{
@@ -2426,7 +2614,7 @@ func TestPlanner_Plan(t *testing.T) {
 																						Path: "deprecationReason",
 																					},
 																				},
-																				ValueType:StringValueType,
+																				ValueType: StringValueType,
 																			},
 																		},
 																	},
@@ -2468,7 +2656,7 @@ func TestPlanner_Plan(t *testing.T) {
 																		Path: "name",
 																	},
 																},
-																ValueType:StringValueType,
+																ValueType: StringValueType,
 															},
 														},
 														{
@@ -2479,7 +2667,7 @@ func TestPlanner_Plan(t *testing.T) {
 																		Path: "description",
 																	},
 																},
-																ValueType:StringValueType,
+																ValueType: StringValueType,
 															},
 														},
 														{
@@ -2491,7 +2679,7 @@ func TestPlanner_Plan(t *testing.T) {
 																	},
 																},
 																Value: &Value{
-																	ValueType:StringValueType,
+																	ValueType: StringValueType,
 																},
 															},
 														},
@@ -2513,7 +2701,7 @@ func TestPlanner_Plan(t *testing.T) {
 																						Path: "name",
 																					},
 																				},
-																				ValueType:StringValueType,
+																				ValueType: StringValueType,
 																			},
 																		},
 																		{
@@ -2524,7 +2712,7 @@ func TestPlanner_Plan(t *testing.T) {
 																						Path: "description",
 																					},
 																				},
-																				ValueType:StringValueType,
+																				ValueType: StringValueType,
 																			},
 																		},
 																		{
@@ -2546,7 +2734,7 @@ func TestPlanner_Plan(t *testing.T) {
 																						Path: "defaultValue",
 																					},
 																				},
-																				ValueType:StringValueType,
+																				ValueType: StringValueType,
 																			},
 																		},
 																	},
@@ -2574,69 +2762,83 @@ func TestPlanner_Plan(t *testing.T) {
 							baz
 						}
 					}
-`, []DataSourceDefinition{
-		{
-			TypeName:  literal.SUBSCRIPTION,
-			FieldName: []byte("stream"),
-			DataSourcePlannerFactory: func() DataSourcePlanner {
-				return &HttpPollingStreamDataSourcePlanner{
-					BaseDataSourcePlanner: BaseDataSourcePlanner{
-						log: log.NoopLogger,
+`,
+		[]DataSourceDefinition{
+			{
+				TypeName:  literal.SUBSCRIPTION,
+				FieldName: []byte("stream"),
+				DataSourcePlannerFactory: func() DataSourcePlanner {
+					return &HttpPollingStreamDataSourcePlanner{
+						BaseDataSourcePlanner: BaseDataSourcePlanner{
+							log: log.NoopLogger,
+						},
+					}
+				},
+			},
+		},
+		PlannerConfiguration{
+			TypeFieldConfigurations: []TypeFieldConfiguration{
+				{
+					TypeName:  "Subscription",
+					FieldName: "stream",
+					Mapping: MappingConfiguration{
+						Disabled: true,
 					},
-				}
+				},
 			},
 		},
-	}, &Object{
-		operationType: ast.OperationTypeSubscription,
-		Fields: []Field{
-			{
-				Name: []byte("data"),
-				Value: &Object{
-					Fetch: &SingleFetch{
-						Source: &DataSourceInvocation{
-							Args: []Argument{
-								&StaticVariableArgument{
-									Name:  literal.HOST,
-									Value: []byte("foo.bar.baz"),
+		&Object{
+			operationType: ast.OperationTypeSubscription,
+			Fields: []Field{
+				{
+					Name: []byte("data"),
+					Value: &Object{
+						Fetch: &SingleFetch{
+							Source: &DataSourceInvocation{
+								Args: []Argument{
+									&StaticVariableArgument{
+										Name:  literal.HOST,
+										Value: []byte("foo.bar.baz"),
+									},
+									&StaticVariableArgument{
+										Name:  literal.URL,
+										Value: []byte("/bal"),
+									},
 								},
-								&StaticVariableArgument{
-									Name:  literal.URL,
-									Value: []byte("/bal"),
+								DataSource: &HttpPollingStreamDataSource{
+									log:   log.NoopLogger,
+									delay: time.Second * 5,
 								},
 							},
-							DataSource: &HttpPollingStreamDataSource{
-								log:   log.NoopLogger,
-								delay: time.Second * 5,
-							},
+							BufferName: "stream",
 						},
-						BufferName: "stream",
-					},
-					Fields: []Field{
-						{
-							Name:            []byte("stream"),
-							HasResolvedData: true,
-							Value: &Object{
-								Fields: []Field{
-									{
-										Name: []byte("bar"),
-										Value: &Value{
-											DataResolvingConfig: DataResolvingConfig{
-												PathSelector: PathSelector{
-													Path: "bar",
+						Fields: []Field{
+							{
+								Name:            []byte("stream"),
+								HasResolvedData: true,
+								Value: &Object{
+									Fields: []Field{
+										{
+											Name: []byte("bar"),
+											Value: &Value{
+												DataResolvingConfig: DataResolvingConfig{
+													PathSelector: PathSelector{
+														Path: "bar",
+													},
 												},
+												ValueType: StringValueType,
 											},
-											ValueType:StringValueType,
 										},
-									},
-									{
-										Name: []byte("baz"),
-										Value: &Value{
-											DataResolvingConfig: DataResolvingConfig{
-												PathSelector: PathSelector{
-													Path: "baz",
+										{
+											Name: []byte("baz"),
+											Value: &Value{
+												DataResolvingConfig: DataResolvingConfig{
+													PathSelector: PathSelector{
+														Path: "baz",
+													},
 												},
+												ValueType: IntegerValueType,
 											},
-											ValueType:IntegerValueType,
 										},
 									},
 								},
@@ -2645,8 +2847,7 @@ func TestPlanner_Plan(t *testing.T) {
 					},
 				},
 			},
-		},
-	}))
+		}))
 	t.Run("http polling stream inline delay", run(withBaseSchema(HttpPollingStreamSchemaInlineDelay), `
 					subscription {
 						stream {
@@ -2654,69 +2855,83 @@ func TestPlanner_Plan(t *testing.T) {
 							baz
 						}
 					}
-`, []DataSourceDefinition{
-		{
-			TypeName:  literal.SUBSCRIPTION,
-			FieldName: []byte("stream"),
-			DataSourcePlannerFactory: func() DataSourcePlanner {
-				return &HttpPollingStreamDataSourcePlanner{
-					BaseDataSourcePlanner: BaseDataSourcePlanner{
-						log: log.NoopLogger,
+`,
+		[]DataSourceDefinition{
+			{
+				TypeName:  literal.SUBSCRIPTION,
+				FieldName: []byte("stream"),
+				DataSourcePlannerFactory: func() DataSourcePlanner {
+					return &HttpPollingStreamDataSourcePlanner{
+						BaseDataSourcePlanner: BaseDataSourcePlanner{
+							log: log.NoopLogger,
+						},
+					}
+				},
+			},
+		},
+		PlannerConfiguration{
+			TypeFieldConfigurations: []TypeFieldConfiguration{
+				{
+					TypeName:  "Subscription",
+					FieldName: "stream",
+					Mapping: MappingConfiguration{
+						Disabled: true,
 					},
-				}
+				},
 			},
 		},
-	}, &Object{
-		operationType: ast.OperationTypeSubscription,
-		Fields: []Field{
-			{
-				Name: []byte("data"),
-				Value: &Object{
-					Fetch: &SingleFetch{
-						Source: &DataSourceInvocation{
-							Args: []Argument{
-								&StaticVariableArgument{
-									Name:  literal.HOST,
-									Value: []byte("foo.bar.baz"),
+		&Object{
+			operationType: ast.OperationTypeSubscription,
+			Fields: []Field{
+				{
+					Name: []byte("data"),
+					Value: &Object{
+						Fetch: &SingleFetch{
+							Source: &DataSourceInvocation{
+								Args: []Argument{
+									&StaticVariableArgument{
+										Name:  literal.HOST,
+										Value: []byte("foo.bar.baz"),
+									},
+									&StaticVariableArgument{
+										Name:  literal.URL,
+										Value: []byte("/bal"),
+									},
 								},
-								&StaticVariableArgument{
-									Name:  literal.URL,
-									Value: []byte("/bal"),
+								DataSource: &HttpPollingStreamDataSource{
+									log:   log.NoopLogger,
+									delay: time.Second * 3,
 								},
 							},
-							DataSource: &HttpPollingStreamDataSource{
-								log:   log.NoopLogger,
-								delay: time.Second * 3,
-							},
+							BufferName: "stream",
 						},
-						BufferName: "stream",
-					},
-					Fields: []Field{
-						{
-							Name:            []byte("stream"),
-							HasResolvedData: true,
-							Value: &Object{
-								Fields: []Field{
-									{
-										Name: []byte("bar"),
-										Value: &Value{
-											DataResolvingConfig: DataResolvingConfig{
-												PathSelector: PathSelector{
-													Path: "bar",
+						Fields: []Field{
+							{
+								Name:            []byte("stream"),
+								HasResolvedData: true,
+								Value: &Object{
+									Fields: []Field{
+										{
+											Name: []byte("bar"),
+											Value: &Value{
+												DataResolvingConfig: DataResolvingConfig{
+													PathSelector: PathSelector{
+														Path: "bar",
+													},
 												},
+												ValueType: StringValueType,
 											},
-											ValueType:StringValueType,
 										},
-									},
-									{
-										Name: []byte("baz"),
-										Value: &Value{
-											DataResolvingConfig: DataResolvingConfig{
-												PathSelector: PathSelector{
-													Path: "baz",
+										{
+											Name: []byte("baz"),
+											Value: &Value{
+												DataResolvingConfig: DataResolvingConfig{
+													PathSelector: PathSelector{
+														Path: "baz",
+													},
 												},
+												ValueType: IntegerValueType,
 											},
-											ValueType:IntegerValueType,
 										},
 									},
 								},
@@ -2725,8 +2940,7 @@ func TestPlanner_Plan(t *testing.T) {
 					},
 				},
 			},
-		},
-	}))
+		}))
 	t.Run("list filter first N", run(withBaseSchema(ListFilterFirstNSchema), `
 			query {
 				foos {
@@ -2743,6 +2957,17 @@ func TestPlanner_Plan(t *testing.T) {
 				},
 			},
 		},
+		PlannerConfiguration{
+			TypeFieldConfigurations: []TypeFieldConfiguration{
+				{
+					TypeName:  "Query",
+					FieldName: "foos",
+					Mapping: MappingConfiguration{
+						Disabled: true,
+					},
+				},
+			},
+		},
 		&Object{
 			operationType: ast.OperationTypeQuery,
 			Fields: []Field{
@@ -2778,7 +3003,7 @@ func TestPlanner_Plan(t *testing.T) {
 															Path: "bar",
 														},
 													},
-													ValueType:StringValueType,
+													ValueType: StringValueType,
 												},
 											},
 										},
@@ -2805,6 +3030,17 @@ func TestPlanner_Plan(t *testing.T) {
 				},
 			},
 		},
+		PlannerConfiguration{
+			TypeFieldConfigurations: []TypeFieldConfiguration{
+				{
+					TypeName:  "Query",
+					FieldName: "stringPipeline",
+					Mapping: MappingConfiguration{
+						Disabled: true,
+					},
+				},
+			},
+		},
 		&Object{
 			operationType: ast.OperationTypeQuery,
 			Fields: []Field{
@@ -2851,7 +3087,7 @@ func TestPlanner_Plan(t *testing.T) {
 								Name:            []byte("stringPipeline"),
 								HasResolvedData: true,
 								Value: &Value{
-									ValueType:StringValueType,
+									ValueType: StringValueType,
 								},
 							},
 						},
@@ -2874,6 +3110,17 @@ func TestPlanner_Plan(t *testing.T) {
 				},
 			},
 		},
+		PlannerConfiguration{
+			TypeFieldConfigurations: []TypeFieldConfiguration{
+				{
+					TypeName:  "Query",
+					FieldName: "filePipeline",
+					Mapping: MappingConfiguration{
+						Disabled: true,
+					},
+				},
+			},
+		},
 		&Object{
 			operationType: ast.OperationTypeQuery,
 			Fields: []Field{
@@ -2917,7 +3164,7 @@ func TestPlanner_Plan(t *testing.T) {
 								Name:            []byte("filePipeline"),
 								HasResolvedData: true,
 								Value: &Value{
-									ValueType:StringValueType,
+									ValueType: StringValueType,
 								},
 							},
 						},
@@ -2942,6 +3189,17 @@ func TestPlanner_Plan(t *testing.T) {
 			  	}
 			}`,
 			ResolverDefinitions{},
+			PlannerConfiguration{
+				TypeFieldConfigurations: []TypeFieldConfiguration{
+					{
+						TypeName:  "Query",
+						FieldName: "apis",
+						Mapping: MappingConfiguration{
+							Disabled: true,
+						},
+					},
+				},
+			},
 			&Object{
 				operationType: ast.OperationTypeQuery,
 				Fields: []Field{
@@ -2981,7 +3239,7 @@ func TestPlanner_Plan(t *testing.T) {
 																			Path: "name",
 																		},
 																	},
-																	ValueType:StringValueType,
+																	ValueType: StringValueType,
 																},
 															},
 														},
@@ -3001,7 +3259,7 @@ func TestPlanner_Plan(t *testing.T) {
 													},
 												},
 												Value: &Value{
-													ValueType:StringValueType,
+													ValueType: StringValueType,
 													DataResolvingConfig: DataResolvingConfig{
 														PathSelector: PathSelector{
 															Path: "status",
@@ -3022,7 +3280,7 @@ func TestPlanner_Plan(t *testing.T) {
 													},
 												},
 												Value: &Value{
-													ValueType:StringValueType,
+													ValueType: StringValueType,
 													DataResolvingConfig: DataResolvingConfig{
 														PathSelector: PathSelector{
 															Path: "message",
@@ -3106,7 +3364,11 @@ func BenchmarkPlanner_Plan(b *testing.B) {
 		},
 	}
 
-	planner := NewPlanner(resolverDefinitions)
+	config := PlannerConfiguration{
+		TypeFieldConfigurations: []TypeFieldConfiguration{},
+	}
+
+	planner := NewPlanner(resolverDefinitions, config)
 	var report operationreport.Report
 
 	b.ResetTimer()
@@ -3126,9 +3388,7 @@ schema {
 }
 type Query {
 	api: ApiResult
-		@mapping(mode: NONE)
 	apis: ApisResult
-		@mapping(mode: NONE)
 }
 type Api {
   id: String
@@ -3136,9 +3396,7 @@ type Api {
 }
 type RequestResult {
   message: String
-  	@mapping(pathSelector: "Message")
   status: String
-  	@mapping(pathSelector: "Status")
 }
 type ApisResultSuccess {
     apis: [Api!]
@@ -3161,7 +3419,6 @@ type Query {
 		@StaticDataSource(
             data: "[{\"bar\":\"baz\"},{\"bar\":\"bal\"},{\"bar\":\"bat\"}]"
         )
-		@mapping(mode: NONE)
 }
 
 type Foo {
@@ -3189,7 +3446,6 @@ type Subscription {
 			host: "foo.bar.baz"
 			url: "/bal"
 		)
-		@mapping(mode: NONE)
 }
 
 type Foo {
@@ -3218,7 +3474,6 @@ type Subscription {
 			url: "/bal"
 			delaySeconds: 3
 		)
-		@mapping(mode: NONE)
 }
 
 type Foo {
@@ -3235,11 +3490,6 @@ directive @GraphQLDataSource (
     params: [Parameter]
 ) on FIELD_DEFINITION
 
-directive @mapping(
-    mode: MAPPING_MODE! = PATH_SELECTOR
-    pathSelector: String
-) on FIELD_DEFINITION
-
 enum MAPPING_MODE {
     NONE
     PATH_SELECTOR
@@ -3342,16 +3592,6 @@ directive @HttpJsonDataSource (
 	body: String
 ) on FIELD_DEFINITION
 
-directive @mapping(
-    mode: MAPPING_MODE! = PATH_SELECTOR
-    pathSelector: String
-) on FIELD_DEFINITION
-
-enum MAPPING_MODE {
-    NONE
-    PATH_SELECTOR
-}
-
 enum HTTP_METHOD {
     GET
     POST
@@ -3359,19 +3599,6 @@ enum HTTP_METHOD {
     DELETE
 }
 
-input Parameter {
-    name: String!
-    sourceKind: PARAMETER_SOURCE!
-    sourceName: String!
-    variableType: String!
-}
-
-enum PARAMETER_SOURCE {
-    CONTEXT_VARIABLE
-    OBJECT_VARIABLE_ARGUMENT
-    FIELD_ARGUMENTS
-}
-
 schema {
     query: Query
 }
@@ -3383,11 +3610,11 @@ type Foo {
 type Headers {
     Accept: String!
     Host: String!
-	acceptEncoding: String @mapping(pathSelector: "Accept-Encoding")
+	acceptEncoding: String
 }
 
 type HttpBinGet {
-	header: Headers! @mapping(pathSelector: "headers")
+	header: Headers!
 }
 
 type JSONPlaceholderPost {
@@ -3408,7 +3635,6 @@ type JSONPlaceholderPost {
                 }
             ]
         )
-		@mapping(mode: NONE)
 }
 
 type JSONPlaceholderComment {
@@ -3426,13 +3652,11 @@ type Query {
             host: "httpbin.org"
             url: "/get"
         )
-		@mapping(mode: NONE)
 	post(id: Int!): JSONPlaceholderPost
         @HttpJsonDataSource(
             host: "jsonplaceholder.typicode.com"
             url: "/posts/{{ .arguments.id }}"
         )
-		@mapping(mode: NONE)
 	withBody(input: WithBodyInput!): String!
         @HttpJsonDataSource(
             host: "httpbin.org"
@@ -3440,7 +3664,6 @@ type Query {
             method: POST
             body: 	"{\"key\":\"{{ .arguments.input.foo }}\"}"
         )
-		@mapping(mode: NONE)
 	withHeaders: String!
         @HttpJsonDataSource(
             host: "httpbin.org"
@@ -3456,25 +3679,21 @@ type Query {
 				}
 			]
         )
-		@mapping(mode: NONE)
 	withPath: String!
 		@HttpJsonDataSource(
             host: "httpbin.org"
             url: "/anything"
         )
-		@mapping(pathSelector: "subObject")
 	listItems: [ListItem]
 		@HttpJsonDataSource(
             host: "httpbin.org"
             url: "/anything"
         )
-		@mapping(mode: NONE)
 	listWithPath: [ListItem]
 		@HttpJsonDataSource(
             host: "httpbin.org"
             url: "/anything"
         )
-		@mapping(pathSelector: "items")
     __schema: __Schema!
     __type(name: String!): __Type
 }
@@ -3503,17 +3722,14 @@ type Query {
 		@StaticDataSource(
             data: "World!"
         )
-		@mapping(mode: NONE)
 	nullableInt: Int
         @StaticDataSource(
             data: null
         )
-		@mapping(mode: NONE)
 	foo: Foo!
         @StaticDataSource(
             data: "{\"bar\":\"baz\"}"
         )
-		@mapping(mode: NONE)
 }`
 
 const complexSchema = `
@@ -3531,11 +3747,6 @@ directive @GraphQLDataSource (
     params: [Parameter]
 ) on FIELD_DEFINITION
 
-directive @mapping(
-    mode: MAPPING_MODE! = PATH_SELECTOR
-    pathSelector: String
-) on FIELD_DEFINITION
-
 enum MAPPING_MODE {
     NONE
     PATH_SELECTOR
@@ -3624,7 +3835,6 @@ type Query {
 			host: "localhost:9001"
 			url: "/user/{{ .arguments.id }}"
 		)
-		@mapping(mode: NONE)
 }
 type User {
 	id: String
@@ -3643,7 +3853,6 @@ type User {
 				}
 			]
 		)
-		@mapping(mode: NONE)
 	pets: [Pet]
 		@GraphQLDataSource(
 			host: "localhost:8002"
@@ -3657,7 +3866,6 @@ type User {
 				}
 			]
 		)
-		@mapping(pathSelector: "userPets")
 }
 interface Pet {
 	nickname: String!
@@ -3699,13 +3907,11 @@ type Query {
 			"""
     		inputJSON: "{\"foo\":\"{{ .arguments.foo }}\"}"
 		)
-		@mapping(mode: NONE)
 	filePipeline(foo: String!): String
 		@PipelineDataSource(
 			configFilePath: "./testdata/simple_pipeline.json"
     		inputJSON: "{\"foo\":\"{{ .arguments.foo }}\"}"
 		)
-		@mapping(mode: NONE)
 }
 `
 
@@ -3939,7 +4145,7 @@ func introspectionQuery(schema []byte) RootNode {
 																Path: "name",
 															},
 														},
-														ValueType:StringValueType,
+														ValueType: StringValueType,
 													},
 												},
 											},
@@ -3962,7 +4168,7 @@ func introspectionQuery(schema []byte) RootNode {
 																Path: "name",
 															},
 														},
-														ValueType:StringValueType,
+														ValueType: StringValueType,
 													},
 												},
 											},
@@ -3985,7 +4191,7 @@ func introspectionQuery(schema []byte) RootNode {
 																Path: "name",
 															},
 														},
-														ValueType:StringValueType,
+														ValueType: StringValueType,
 													},
 												},
 											},
@@ -4009,7 +4215,7 @@ func introspectionQuery(schema []byte) RootNode {
 																	Path: "kind",
 																},
 															},
-															ValueType:StringValueType,
+															ValueType: StringValueType,
 														},
 													},
 													{
@@ -4020,7 +4226,7 @@ func introspectionQuery(schema []byte) RootNode {
 																	Path: "name",
 																},
 															},
-															ValueType:StringValueType,
+															ValueType: StringValueType,
 														},
 													},
 													{
@@ -4031,7 +4237,7 @@ func introspectionQuery(schema []byte) RootNode {
 																	Path: "description",
 																},
 															},
-															ValueType:StringValueType,
+															ValueType: StringValueType,
 														},
 													},
 													{
@@ -4052,7 +4258,7 @@ func introspectionQuery(schema []byte) RootNode {
 																					Path: "name",
 																				},
 																			},
-																			ValueType:StringValueType,
+																			ValueType: StringValueType,
 																		},
 																	},
 																	{
@@ -4063,7 +4269,7 @@ func introspectionQuery(schema []byte) RootNode {
 																					Path: "description",
 																				},
 																			},
-																			ValueType:StringValueType,
+																			ValueType: StringValueType,
 																		},
 																	},
 																	{
@@ -4084,7 +4290,7 @@ func introspectionQuery(schema []byte) RootNode {
 																									Path: "name",
 																								},
 																							},
-																							ValueType:StringValueType,
+																							ValueType: StringValueType,
 																						},
 																					},
 																					{
@@ -4095,7 +4301,7 @@ func introspectionQuery(schema []byte) RootNode {
 																									Path: "description",
 																								},
 																							},
-																							ValueType:StringValueType,
+																							ValueType: StringValueType,
 																						},
 																					},
 																					{
@@ -4117,7 +4323,7 @@ func introspectionQuery(schema []byte) RootNode {
 																									Path: "defaultValue",
 																								},
 																							},
-																							ValueType:StringValueType,
+																							ValueType: StringValueType,
 																						},
 																					},
 																				},
@@ -4143,7 +4349,7 @@ func introspectionQuery(schema []byte) RootNode {
 																					Path: "isDeprecated",
 																				},
 																			},
-																			ValueType:BooleanValueType,
+																			ValueType: BooleanValueType,
 																		},
 																	},
 																	{
@@ -4154,7 +4360,7 @@ func introspectionQuery(schema []byte) RootNode {
 																					Path: "deprecationReason",
 																				},
 																			},
-																			ValueType:StringValueType,
+																			ValueType: StringValueType,
 																		},
 																	},
 																},
@@ -4179,7 +4385,7 @@ func introspectionQuery(schema []byte) RootNode {
 																					Path: "name",
 																				},
 																			},
-																			ValueType:StringValueType,
+																			ValueType: StringValueType,
 																		},
 																	},
 																	{
@@ -4190,7 +4396,7 @@ func introspectionQuery(schema []byte) RootNode {
 																					Path: "description",
 																				},
 																			},
-																			ValueType:StringValueType,
+																			ValueType: StringValueType,
 																		},
 																	},
 																	{
@@ -4212,7 +4418,7 @@ func introspectionQuery(schema []byte) RootNode {
 																					Path: "defaultValue",
 																				},
 																			},
-																			ValueType:StringValueType,
+																			ValueType: StringValueType,
 																		},
 																	},
 																},
@@ -4250,7 +4456,7 @@ func introspectionQuery(schema []byte) RootNode {
 																					Path: "name",
 																				},
 																			},
-																			ValueType:StringValueType,
+																			ValueType: StringValueType,
 																		},
 																	},
 																	{
@@ -4261,7 +4467,7 @@ func introspectionQuery(schema []byte) RootNode {
 																					Path: "description",
 																				},
 																			},
-																			ValueType:StringValueType,
+																			ValueType: StringValueType,
 																		},
 																	},
 																	{
@@ -4272,7 +4478,7 @@ func introspectionQuery(schema []byte) RootNode {
 																					Path: "isDeprecated",
 																				},
 																			},
-																			ValueType:BooleanValueType,
+																			ValueType: BooleanValueType,
 																		},
 																	},
 																	{
@@ -4283,7 +4489,7 @@ func introspectionQuery(schema []byte) RootNode {
 																					Path: "deprecationReason",
 																				},
 																			},
-																			ValueType:StringValueType,
+																			ValueType: StringValueType,
 																		},
 																	},
 																},
@@ -4325,7 +4531,7 @@ func introspectionQuery(schema []byte) RootNode {
 																	Path: "name",
 																},
 															},
-															ValueType:StringValueType,
+															ValueType: StringValueType,
 														},
 													},
 													{
@@ -4336,7 +4542,7 @@ func introspectionQuery(schema []byte) RootNode {
 																	Path: "description",
 																},
 															},
-															ValueType:StringValueType,
+															ValueType: StringValueType,
 														},
 													},
 													{
@@ -4348,7 +4554,7 @@ func introspectionQuery(schema []byte) RootNode {
 																},
 															},
 															Value: &Value{
-																ValueType:StringValueType,
+																ValueType: StringValueType,
 															},
 														},
 													},
@@ -4370,7 +4576,7 @@ func introspectionQuery(schema []byte) RootNode {
 																					Path: "name",
 																				},
 																			},
-																			ValueType:StringValueType,
+																			ValueType: StringValueType,
 																		},
 																	},
 																	{
@@ -4381,7 +4587,7 @@ func introspectionQuery(schema []byte) RootNode {
 																					Path: "description",
 																				},
 																			},
-																			ValueType:StringValueType,
+																			ValueType: StringValueType,
 																		},
 																	},
 																	{
@@ -4403,7 +4609,7 @@ func introspectionQuery(schema []byte) RootNode {
 																					Path: "defaultValue",
 																				},
 																			},
-																			ValueType:StringValueType,
+																			ValueType: StringValueType,
 																		},
 																	},
 																},
@@ -4433,7 +4639,7 @@ var kindNameDeepFields = []Field{
 					Path: "kind",
 				},
 			},
-			ValueType:StringValueType,
+			ValueType: StringValueType,
 		},
 	},
 	{
@@ -4444,7 +4650,7 @@ var kindNameDeepFields = []Field{
 					Path: "name",
 				},
 			},
-			ValueType:StringValueType,
+			ValueType: StringValueType,
 		},
 	},
 	{
@@ -4464,7 +4670,7 @@ var kindNameDeepFields = []Field{
 								Path: "kind",
 							},
 						},
-						ValueType:StringValueType,
+						ValueType: StringValueType,
 					},
 				},
 				{
@@ -4475,7 +4681,7 @@ var kindNameDeepFields = []Field{
 								Path: "name",
 							},
 						},
-						ValueType:StringValueType,
+						ValueType: StringValueType,
 					},
 				},
 				{
@@ -4495,7 +4701,7 @@ var kindNameDeepFields = []Field{
 											Path: "kind",
 										},
 									},
-									ValueType:StringValueType,
+									ValueType: StringValueType,
 								},
 							},
 							{
@@ -4506,7 +4712,7 @@ var kindNameDeepFields = []Field{
 											Path: "name",
 										},
 									},
-									ValueType:StringValueType,
+									ValueType: StringValueType,
 								},
 							},
 							{
@@ -4526,7 +4732,7 @@ var kindNameDeepFields = []Field{
 														Path: "kind",
 													},
 												},
-												ValueType:StringValueType,
+												ValueType: StringValueType,
 											},
 										},
 										{
@@ -4537,7 +4743,7 @@ var kindNameDeepFields = []Field{
 														Path: "name",
 													},
 												},
-												ValueType:StringValueType,
+												ValueType: StringValueType,
 											},
 										},
 										{
@@ -4557,7 +4763,7 @@ var kindNameDeepFields = []Field{
 																	Path: "kind",
 																},
 															},
-															ValueType:StringValueType,
+															ValueType: StringValueType,
 														},
 													},
 													{
@@ -4568,7 +4774,7 @@ var kindNameDeepFields = []Field{
 																	Path: "name",
 																},
 															},
-															ValueType:StringValueType,
+															ValueType: StringValueType,
 														},
 													},
 													{
@@ -4588,7 +4794,7 @@ var kindNameDeepFields = []Field{
 																				Path: "kind",
 																			},
 																		},
-																		ValueType:StringValueType,
+																		ValueType: StringValueType,
 																	},
 																},
 																{
@@ -4599,7 +4805,7 @@ var kindNameDeepFields = []Field{
 																				Path: "name",
 																			},
 																		},
-																		ValueType:StringValueType,
+																		ValueType: StringValueType,
 																	},
 																},
 																{
@@ -4619,7 +4825,7 @@ var kindNameDeepFields = []Field{
 																							Path: "kind",
 																						},
 																					},
-																					ValueType:StringValueType,
+																					ValueType: StringValueType,
 																				},
 																			},
 																			{
@@ -4630,7 +4836,7 @@ var kindNameDeepFields = []Field{
 																							Path: "name",
 																						},
 																					},
-																					ValueType:StringValueType,
+																					ValueType: StringValueType,
 																				},
 																			},
 																			{
@@ -4650,7 +4856,7 @@ var kindNameDeepFields = []Field{
 																										Path: "kind",
 																									},
 																								},
-																								ValueType:StringValueType,
+																								ValueType: StringValueType,
 																							},
 																						},
 																						{
@@ -4661,7 +4867,7 @@ var kindNameDeepFields = []Field{
 																										Path: "name",
 																									},
 																								},
-																								ValueType:StringValueType,
+																								ValueType: StringValueType,
 																							},
 																						},
 																					},
diff --git a/pkg/execution/transformation_test.go b/pkg/execution/transformation_test.go
index ff5eae04..569593eb 100644
--- a/pkg/execution/transformation_test.go
+++ b/pkg/execution/transformation_test.go
@@ -100,6 +100,16 @@ func TestPlanner_WithTransformation(t *testing.T) {
 				return &StaticDataSourcePlanner{}
 			},
 		},
+	}, PlannerConfiguration{
+		TypeFieldConfigurations: []TypeFieldConfiguration{
+			{
+				TypeName: "Query",
+				FieldName: "foo",
+				Mapping:MappingConfiguration{
+					Disabled:true,
+				},
+			},
+		},
 	}, &Object{
 		operationType: ast.OperationTypeQuery,
 		Fields: []Field{
@@ -151,6 +161,16 @@ func TestPlanner_WithTransformation(t *testing.T) {
 				return &StaticDataSourcePlanner{}
 			},
 		},
+	}, PlannerConfiguration{
+		TypeFieldConfigurations: []TypeFieldConfiguration{
+			{
+				TypeName: "Query",
+				FieldName: "bar",
+				Mapping:MappingConfiguration{
+					Disabled:true,
+				},
+			},
+		},
 	}, &Object{
 		operationType: ast.OperationTypeQuery,
 		Fields: []Field{
@@ -212,7 +232,6 @@ type Query {
         @StaticDataSource(
             data: "{\"bar\":\"baz\"}"
         )
-		@mapping(mode: NONE)
 		@transformation(
 			mode: PIPELINE
 			pipelineConfigString: """
@@ -229,7 +248,6 @@ type Query {
         @StaticDataSource(
             data: "{\"bar\":\"baz\"}"
         )
-		@mapping(mode: NONE)
 		@transformation(
 			mode: PIPELINE
 			pipelineConfigFile: "./testdata/simple_pipeline.json"