graphql-client icon indicating copy to clipboard operation
graphql-client copied to clipboard

Cannot compile queries without parameters

Open craftytrickster opened this issue 3 years ago • 3 comments

I am able to successfully compile examples that have variables such as

query PuppySmiles($after: String) {
  reddit {
    subreddit(name: "puppysmiles") {
      newListings(limit: 6, after: $after) {
        title
        fullnameId
        url
      }
    }
  }
}

but if I try to use a query that does not have a variable (in this case, after)

query FooBar {
  reddit {
    subreddit(name: "puppysmiles") {
      newListings(limit: 6, after: "foobar") {
        title
        fullnameId
        url
      }
    }
  }
}

The code does not compile for me.

craftytrickster avatar Dec 07 '21 00:12 craftytrickster

Same problem, I cannot use any query that does not use variables(Which is most of them...)

SylvainMartel avatar Jan 17 '22 21:01 SylvainMartel

I just checked out this repo to fix this, and it seems like it actually already works in the repo. It seems that maybe they have not performed a cargo publish in a very long time (7 months), so perhaps it was fixed but never published.

craftytrickster avatar Jan 17 '22 23:01 craftytrickster

indeed, pointing to the repo directly, that part of the code compile, thanks for the tips!

Edit: other error I had were related to custom scalar that I had to fix.

SylvainMartel avatar Jan 18 '22 17:01 SylvainMartel

Either this was fixed, or this repo is abandonware, so closing

craftytrickster avatar Feb 23 '24 15:02 craftytrickster