DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

Cover image for GraphQL Placeholder
King Rayhan
King Rayhan

Posted on • Updated on

GraphQL Placeholder

https://graphqlplaceholder.com/

What is this?

GraphQL Placeholder is great for frontend developers building GraphQL powered apps or for quick testing a GraphQL API. If you’re learning Apollo Client, GraphQL Placeholder gives you the following Types you can query;

Types

// # -------------- All Queries -------------- #
type Query {
    user(userId: Int!): User!
    users: [User!]
    post(postId: ID!): Post!
    posts: [Post!]
    comment(commentId: ID!): Comment!
    comments: [Comment!]
}
Enter fullscreen mode Exit fullscreen mode

Mutations

// # -------------- All Mutations -------------- #
type Mutation {

    addPost(data: PostInput!): Post!
    updatePost(postId: ID!, data: PostUpdateInput!): Post!
    deletePost(postId: ID!): Post!


    addComment(data: CommentInput!): Comment!
    updateComment(commentId: ID!, data: CommentUpdateInput!): Comment!
    deleteComment(commentId: ID!): Comment!

}
Enter fullscreen mode Exit fullscreen mode

How?

You can send requests to https://api.graphqlplaceholder.com/ via a library like graphql-request.

Going forward

The application is completely available on GitHub. You can submit a PR for any additional queries/mutations that are useful.
I hope this project helps other’s getting started with Apollo + GraphQL and removes the worry of building an actual GraphQL server.

GraphQL Placeholder

GraphQL Placeholder is great for frontend developers building GraphQL powered apps or for quick testing a GraphQL API. If you’re learning Apollo Client, GraphQL Placeholder gives you the following Types you can query;

http://bit.ly/create-ghost-theme

Top comments (0)

DEV

Thank you.

Β 
Thanks for visiting DEV, we’ve worked really hard to cultivate this great community and would love to have you join us. If you’d like to create an account, you can sign up here.