Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exposes DefaultResolveFn outside the lib #227

Merged
merged 2 commits into from
Aug 5, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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