Tag: netflix-dgs
-
Graphql : Get parent’s parent source – getSource() in graphql java
0 Let say I have following schema type Org { vp: Person! employees: [Person!]! } type Person { id: ID! name: String! grade: String! @auth } I have auth directive implemented in DGS as below @DgsDirective(name = "auth") public class PrincipleAuthorizationDirective implements SchemaDirectiveWiring { @Override public GraphQLFieldDefinition onField(SchemaDirectiveWiringEnvironment<GraphQLFieldDefinition> environment) { GraphQLFieldDefinition field = environment.getElement(); GraphQLFieldsContainer…
-
In graphql what is difference between a `type query` and `extend type query`?
0 In graphql what is difference between a type query and extend type query? Ex: difference between type Query { product(id: String!): Product } and extend type Query { DeviceDetail(devId: String!): DeviceDetail } Will appreciate if you could add an example for your explanation. graphql graphql-java spring-graphql netflix-dgs Share Improve this question Follow asked 1…
-
Propagate data from parent to data data loader DGS netflix
0 I implement the data loader return object. so I need to put this object in another data loader child . can you help me to understand how to propagate data from the parent to child data loader ? graphql netflix-dgs Share Improve this question Follow asked 56 mins ago BRAIEK AYEMNBRAIEK AYEMN 8911 silver…
-
Graphql Inner and Left Join
1 We are using Apollo Router + Netflix DGS to build federated graphql services. Suppose that we have a common relational database right now for books and authors, but want to move towards a microservice architecture, where books and authors are stored separately in their own database. Suppose that I have the following graphql schema:…
-
com.netflix.graphql.dgs:graphql-dgs-client version compatibility with spring boot 3.x
0 I am currently using com.netflix.graphql.dgs:graphql-dgs-client version 4.9.15. This worked well with spring boot 2.6.6. On upgrading to spring boot 3.x specifically 3.1.3 I am seeing few failures (If required I can add more details about this). So I upgraded dgs client – com.netflix.graphql.dgs:graphql-dgs-client to 7.6.0. After upgrade, few things are working but other things…
-
Dataloader is using only recent context
0 I have defined a custom context as below @Component public class MyContextBuilder implements DgsCustomContextBuilder<MyContexttBuilder.MyContext> { @Override public MyContext build() { return new MyContext(); } public static class MyContext { private String customState = "Custom CID!"; public String getCustomState() { return customState; } public void setCustomState(String state) { customState = state; } } } Datafetcher…
-
Complex type in Netflix dgs entityfetcher
0 I have defined Subgraphs to fetch data from multiple sources type MyResult{ id: ID innerResults: [InnerResult] @external otherResults: [OtherResult] @requires(fields: "innerResults") } DgsEntityFetcher looks like below @DgsEntityFetcher(name = DgsConstants.MYRESULT.TYPE_NAME) public DataFetcherResult<MyResult> getResults(Map<String, Object> values) { values.forEach((k,val) -> log.warn("key {} value{}",k,val)); return DataFetcherResult.<MyResult>newResult() .data(PlacedDeviceResult.newBuilder().Id((String)values.get("id")).innerResults((List<InnerResult>) values.get("innerResults")).build()) .build(); } But this is not working giving exception java.util.LinkedHashMap…
-
Federated Graphql in case of list of items
0 I have defined Subgraphs as below and data is fetched from multiple sources Subgraph A type Query { getAllItems(type: String!) : AllItems } type AllItems{ type: String response: QueryResponse items: [Item!]! pageInfo: Page totalCount: Int } type Item @key(fields: "id") { val1: String val2: String id: ID! } SubgraphB type Item @key(fields: "id") @extends…
-
Netflix DGS configuration dgs.graphql.graphiql.enabled=true is not working
0 Netflix DGS configuration dgs.graphql.graphiql.enabled=true is not working. I have also added this config – dgs.graphql.graphiql.path=/graphiql I have a spring boot application in maven and I have implemented my graphQL APIs using Netflix DGS. APIs are working fine using postman but when I try to enable graphiql by hitting /graphiql end point, it gives me…
-
How to handle security (authn/authz) with DGS Subscriptions and spring security?
0 I’m mirroring a question asked directly on GitHub here. I’m up to the point where if I authorize("/subscriptions",permitAll) while configuring my SecurityWebFilterChain then I can successfully use my subscription queries. However, that removes all the security. I would have liked to do: authorize("/subscriptions",hasAuthority("access")) Anyway, now I need to make sur that the user is…