Skip to content

Commit

Permalink
Merge pull request #227 from graphql-go/housinganywhere/expose-defaul…
Browse files Browse the repository at this point in the history
…t-resolve-function

exposes `DefaultResolveFn` outside the lib
  • Loading branch information
chris-ramon authored Aug 5, 2017
2 parents d5d756c + b8d3ca6 commit 1486d45
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ func resolveField(eCtx *ExecutionContext, parentType *Object, source interface{}
returnType = fieldDef.Type
resolveFn := fieldDef.Resolve
if resolveFn == nil {
resolveFn = defaultResolveFn
resolveFn = DefaultResolveFn
}

// Build a map of arguments from the field.arguments AST, using the
Expand Down Expand Up @@ -824,7 +824,7 @@ func defaultResolveTypeFn(p ResolveTypeParams, abstractType Abstract) *Object {
// which takes the property of the source object of the same name as the field
// and returns it as the result, or if it's a function, returns the result
// of calling that function.
func defaultResolveFn(p ResolveParams) (interface{}, error) {
func DefaultResolveFn(p ResolveParams) (interface{}, error) {
// try to resolve p.Source as a struct first
sourceVal := reflect.ValueOf(p.Source)
if sourceVal.IsValid() && sourceVal.Type().Kind() == reflect.Ptr {
Expand Down

0 comments on commit 1486d45

Please sign in to comment.