forked from odeddoek/graphql-java-spring-example
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQuery.java
More file actions
35 lines (27 loc) · 879 Bytes
/
Copy pathQuery.java
File metadata and controls
35 lines (27 loc) · 879 Bytes
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
package graphql;
import domain.Product;
import domain.Store;
import graphql.annotations.GraphQLDataFetcher;
import graphql.annotations.GraphQLField;
import graphql.annotations.GraphQLName;
import graphql.fetchers.ProductDataFetcher;
import graphql.fetchers.ProductsDataFetcher;
import graphql.fetchers.StoreDataFetcher;
import org.springframework.stereotype.Component;
import java.util.List;
@Component
public class Query {
@GraphQLField
@GraphQLDataFetcher(ProductDataFetcher.class)
public Product product(@GraphQLName("product_id") int product_id) {
return null;
}
@GraphQLField
@GraphQLDataFetcher(StoreDataFetcher.class)
public Store store(@GraphQLName("store_id") int store_id) {
return null;
}
@GraphQLField
@GraphQLDataFetcher(ProductsDataFetcher.class)
public List<Product> products() { return null;}
}