Skip to content

Repository files navigation

graphql-ruby

Installation

Install dependencies:

bundle install
rails db:setup

Starting the server:

rails server

Opening the application:

open http://localhost:3000/

Interesting Files:

Sample GraphQL Queries

List first 10 links, containing "example":

{
allLinks(first: 10, filter: {descriptionContains: "example"}) {
idurldescriptioncreatedAtpostedBy {
idname
}
}
}

Creates new user:

mutation {
createUser(
name: "Radoslav Stankov",
authProvider: {
credentials: { email: "rado@example.com", password: "123456" }
}
) {
idemailname
}
}

Creates new user token:

mutation {
signinUser(credentials: {email: "rado@example.com", password: "123456"}) {
tokenuser {
idemailname
}
}
}

Creates new link:

mutation {
createLink(url:"http://example.com", description:"Example") {
idurldescriptionpostedBy {
idname
}
}
}

Creates new vote:

mutation {
createVote(linkId:"TGluay0yMQ==") {
user {
idname
}
link {
idurldescription
}
}
}

Releases

Packages

Used by

Contributors

Languages