Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Merge remote-tracking branch 'upstream/master' into 772-more-aggressi…
…ve-property-fetcher

# Conflicts:
#	src/main/java/graphql/schema/PropertyDataFetcher.java
  • Loading branch information
bbakerman committed Nov 2, 2017
commit 1fbed559cddb04575c9924e71c3c0d23a441e088
5 changes: 4 additions & 1 deletion src/main/java/graphql/schema/PropertyDataFetcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import graphql.Assert;
import graphql.GraphQLException;
import graphql.PublicApi;
import graphql.schema.idl.TypeRuntimeWiring;

import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
Expand All @@ -13,17 +12,21 @@
import java.util.Arrays;
import java.util.Map;
import java.util.Optional;
import java.util.function.Function;

import static graphql.Scalars.GraphQLBoolean;

/**
* This is the default data fetcher used in graphql-java. It will examine
* maps and POJO java beans for values that match the desired name, typically the field name
* or it will use a provided function to obtain values.
* maps and POJO java beans for values that match the desired name.
*
* It uses the following strategies
* <ul>
* <li>If the source is null, return null</li>
* <li>If the source is a Map, return map.get(propertyName)</li>
* <li>If a function is provided, it is used</li>
* <li>Find a public JavaBean getter method named `propertyName`</li>
* <li>Find any getter method named `propertyName` and call method.setAccessible(true)</li>
* <li>Find a public field named `propertyName`</li>
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.