DEV Community

Cover image for GraphQL Placeholder
King Rayhan
King Rayhan

Posted on • Edited 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)