forked from graphql-java/graphql-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExecutionResult.java
More file actions
42 lines (34 loc) · 1.22 KB
/
ExecutionResult.java
File metadata and controls
42 lines (34 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package graphql;
import java.util.List;
import java.util.Map;
/**
* This simple value class represents the result of performing a graphql query.
*/
@PublicApi
@SuppressWarnings("TypeParameterUnusedInFormals")
public interface ExecutionResult {
/**
* @param <T> allows type coercion
*
* @return the data in the result or null if there is none
*/
<T> T getData();
/**
* @return the errors that occurred during execution or empty list if there is none
*/
List<GraphQLError> getErrors();
/**
* @return a map of extensions or null if there are none
*/
Map<Object, Object> getExtensions();
/**
* The graphql specification says that result of a call should be a map that follows certain rules on what items
* should be present. Certain JSON serializers may or may interpret {@link ExecutionResult} to spec, so this method
* is provided to produce a map that strictly follows the specification.
*
* See : <a href="http://facebook.github.io/graphql/#sec-Response-Format">http://facebook.github.io/graphql/#sec-Response-Format</a>
*
* @return a map of the result that strictly follows the spec
*/
Map<String, Object> toSpecification();
}