Skip to content

AL-Khawaja/Graphql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

README: Running the GraphQL Service

how to set up and run a GraphQL service to query Worldwide country.

Tools Needed

  • IDE: With a terminal (e.g., VS Code, IntelliJ)
  • Docker: Installed and running
  • Git: For cloning the repository
  • cURL: For testing the service

Instructions

  1. Clone the Repository
    Run the following command to clone the GraphQL service code:

    git clone https://github.com/Al-khawaja/Graphql.git
  2. Build the Docker Image
    Build the Docker application and tag it e.g graphqlservice:

    docker build . -t graphqlservice
  3. Run the Application
    Start the service on port 8080:

    docker run -dp 8080:4000 graphqlservice

    A hex code will confirm the application has started.

  4. Verify the Service
    Check if the service is running:

    curl localhost:8080

    If the output matches the expected format which is: "Copy the URL from the address-bar, to paste in Postman to use GraphQL", the service is up.

  5. Verify the Service
    Check if the service is running:

    curl localhost:8080

    If the output matches the expected format which is: "Copy the URL from the address-bar, to paste in Postman to use GraphQL", the service is up.

    curl -X POST <URL> -H "Content-Type: application/json" -d '{"query": "{ cities(country: \"Jordan\") { city Latitude Longitude country iso3 population } }"}'

Notes

  • Ensure Docker is running before executing the commands.
  • The service will be available at localhost:8080 or the provided URL.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors