Make sure Docker is installed on your machine. If not, you can download and install it from here.
Open a terminal or command prompt on your system:
Win + R, type cmd or PowerShell, and press Enter.Terminal from the Applications > Utilities folder.Ctrl + Alt + T.Run the following command to download the Docker image from Docker Hub:
docker pull 2424833f/graphql-image
Once the image is downloaded, you can run the container with the following command:
docker run -d -p 4000:4000 --name graphql-app 2424833f/graphql-image
To verify that the container is running, execute:
docker ps
Once the container is running, access the application in your browser or GraphQL client at:
http://localhost:4000
If you need to access the container logs, use the following command:
docker logs graphql-app
To stop the container, use:
docker stop graphql-app
To remove the stopped container, use:
docker rm graphql-app
Find a Person by Name:
query {
findPerson(name: "Freddy Moreira") {
name
phone
address {
street
city
}
id
}
}
Fetch All Persons:
query {
allPersons {
name
phone
address {
street
city
}
id
}
}
mutation {
addPerson(
name: "Juanito Alimaña"
phone: "09000000123"
street: "Av. Salcedo"
city: "Cuenca"
) {
name
phone
address {
street
city
}
id
}
}
npm install apollo-server graphql uuid
-You can use a GraphQL client like GraphiQL or Postman to interact with the API.
-For any questions, here is the GraphQL GitHub repository where you can find more details to guide you through the project.
Content type
Image
Digest
sha256:86186c008…
Size
68.3 MB
Last updated
almost 2 years ago
docker pull 2424833f/graphql-image