Coder Social home page Coder Social logo

Comments (8)

ferdinandsalis avatar ferdinandsalis commented on May 8, 2024 1

☺️ Glad you solved the problem.

from crystal.

ferdinandsalis avatar ferdinandsalis commented on May 8, 2024

Instead of using wget or curl I suggest using graphiql, its the graphical interface for your graphql endpoint. If you start up PostGraphQL with the --development flag you can access it at the entry point of your grahlql server.

The error message is actually very descriptive. It just says that its missing the id argument. So to make your query work you need to add the id attribute to the query, which could look like this:

{
  post(id: "YXJ0aXN0OjE=") { 
    id 
  }
}

This would get the post's id field belonging to the post. This is using the opaque id generated by PostGraphQL. If you want to use the id's of your database you will need to do the following:

{
  postByRowId(rowId: 1) {
    id
  }
}

I hope this helped.

from crystal.

dbkaplun avatar dbkaplun commented on May 8, 2024

Yes, I am familiar with the GraphiQL interface. I meant to add some curl commands specifically, because they are self-contained and serve as kind of canonical representations of HTTP requests. Any graphql query would do as the forum example has no sample queries. :/

Here is the solution I found to my problem:

{
  postNodes {
    nodes {
      id
    }
  }
}

from crystal.

dbkaplun avatar dbkaplun commented on May 8, 2024

So are you planning on adding some sample queries to the forum example? Would be super helpful

from crystal.

ferdinandsalis avatar ferdinandsalis commented on May 8, 2024

Adding sample queries to the forum example and explaining them would definitely help people new to GraphQL so I guess it would make sense. What do you think @calebmer?

from crystal.

calebmer avatar calebmer commented on May 8, 2024

Yeah, adding sample queries is definetly something we should do.

from crystal.

dbkaplun avatar dbkaplun commented on May 8, 2024

Made a PR with some sample queries: #85

from crystal.

ferdinandsalis avatar ferdinandsalis commented on May 8, 2024

@dbkaplun thank you for the contribution!

from crystal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.