Skip to content

ash-sykes/java-graphql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Java Mongo GraphQL

Set-up

As we use dot env you will need to create mongo.env in the project dir and add:

MONGO_INITDB_ROOT_USERNAME=root
MONGO_INITDB_ROOT_PASSWORD=example
MONGO_INITDB_DATABASE=admin
MONGO_HOST=mongo

Running MongoDB

  • In a terminal enter docker-compose up -d mongo

Running Server (docker)

  • In a terminal enter docker-compose up -d server
  • Visit GraphiQL in your browser

Running server (command line)

  • In a terminal run: mvn spring-boot:run
  • Visit GraphiQL in your browser

Example Queries

Here are some sample queries that you can execute via GraphiQL:

query CertainUserQuery {
  user(id: "5cee7e5ce032770277afc497") {
    name,
    articles {
      title
    }
  }
}

query AllUsersQuery {
  users {
    name
    id
  }
}

query CertainArticleQuery {
  article(id: "5cee7eef78479805c956a0fc") {
    title
  }
}

query AllArticlesQuery {
  articles {
    title
    id
  }
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published