💛Get Started
In this quick guide we will look making simple requests to our the Rocketmeme GraphQL API.
Access is free
You don't need an API key to use our API.
Making your first request
GraphQL API
We'll do a simple query to get meme categories using different languages.
fetch('https://rocketmeme-user.hasura.app/v1/graphql', {
method: 'POST',
headers: {
'content-type': 'application/json',
},
body: JSON.stringify({"operationName":"getPaginatedMemeCategories","variables":{},"query":"query getPaginatedMemeCategories {\n meme_categories_aggregate(limit: 10, offset: 0) {\n nodes {\n id\n category_title\n no_of_memes\n thumb_nail\n __typename\n }\n __typename\n }\n count: memes_aggregate(offset: 0) {\n aggregate {\n count\n __typename\n }\n __typename\n }\n}\n"})
});import fetch from "node-fetch";
const query = `
query getMemes {
memes(limit: 3) {
id
title
image_link
}
}
`;
const result = await fetch("https://rocketmeme-user.hasura.app/v1/graphql", {
method: "POST",
headers: {
"content-type": "application/json",
},
body: JSON.stringify({
operationName: "getMemes",
variables: {},
query: query,
}),
});
const data = await result.json();
console.log(data);import requests
json_data = {
'operationName': 'getPaginatedMemeCategories',
'variables': {},
'query': 'query getPaginatedMemeCategories {\n meme_categories_aggregate(limit: 10, offset: 0) {\n nodes {\n id\n category_title\n no_of_memes\n thumb_nail\n __typename\n }\n __typename\n }\n count: memes_aggregate(offset: 0) {\n aggregate {\n count\n __typename\n }\n __typename\n }\n}\n',
}
response = requests.post('https://rocketmeme-user.hasura.app/v1/graphql', json=json_data)
print(response.content)Rest API
To make your first request, send a request to the memes endpoint. This will return a list of memes, which is nice.
Create pet.
POST https://api.myapi.com/v1/pet
Creates a new pet.
Request Body
Name
Type
Description
name*
string
The name of the pet
owner_id
string
The
id
of the user who owns the pet
species
string
The species of the pet
breed
string
The breed of the pet
{
"name"="Wilson",
"owner": {
"id": "sha7891bikojbkreuy",
"name": "Samuel Passet",
"species": "Dog",}
"breed": "Golden Retriever",
}Last updated
