question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Question on how to define queries on Domain types?

See original GitHub issue

I am new to GraphQL so any help would be appreciated. Currently I understand if I have to define queries on Domain types, I will need to add annotations in the same file, something like this:

public class A {
    private String id;
    private List<B> bList;

    @GraphQLQuery(name = "bList")
    public List<B> getBListByX(@GraphQLArgument(name = "x") final String x)
   }

This generates schema like:

 type A {
   id: String
   bList(x: String): [B]
 }

We have existing POJOs which we want to use for generating the schema but I do not want to add the query annotations on the POJO itself. Is there any way in which I can add the queries separately in a different file, without having to handwrite all POJOs

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
kaqqaocommented, Mar 7, 2018

Oh, just by the name of QUERY_ROOT I can tell you’re using an old version of SPQR. Earlier implementations used to behave differently in that nested queries would also be exposed as top level (taking the context argument explicitly). Plus, there may have been a bug making the nested one also expect an argument. Please try using the latest (0.9.6 at the moment, and 0.9.7 coming out by the end of the week). It should behave as expected there.

0reactions
kaqqaocommented, Mar 8, 2018

Great! v0.9.7 will have deduping logic for methods between queries and mutations (the current logic dedupes only within one type), so these errors should go away permanently. Closing this one.

Read more comments on GitHub >

github_iconTop Results From Across the Web

DNS Types: Types of DNS Records, Servers and Queries - NS1
Need a refresher on DNS concepts? This post introduces DNS and explains: 3 types of DNS queries—recursive, iterative, and non-recursive; 3 types of...
Read more >
DNS query types and how to use DNS in performance ...
Type “NS” (Name Server) to get information about the authoritative name server. Type “SOA” (Start Of zone Authority): used when transferring ...
Read more >
What Is a DNS Query? How does it work? - Bunny.net
A DNS query is a message sent by the client to the DNS server and can be one of 3 different types: Non-Recursive...
Read more >
What is DNS? How Domain Name System works - TechTarget
Learn about the domain name system, how it works, the types of DNS servers in use, DNS security concerns and the history of...
Read more >
What is a DNS query? - ClouDNS
An attempt to reach a domain, is actually a DNS client querying the DNS servers to get the IP address, related to that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found