GithubHelp home page GithubHelp logo

api-university's Introduction

API University

Technologies

How to run

Clone the repository, make sure you rename the .env.example file to .env and fill the variables with your own values.

after that, run the following command:

docker compose up -d

This command will build and pull the missing the images and run the containers.

The application will run at: http://localhost:4000/api

You can see the available graphql queries and mutations in the playground at https://studio.apollographql.com/sandbox/explorer

Available queries and mutations

Queries

  • users - get a list with all the users
  • session
    • get - get the basic information about the session, like the id and the expiration date
    • getInfo - get the basic information about the session and the user together with its roles

Mutations

  • roles
    • create - create a new role
    • update - update a role
    • delete - delete a role
  • users
    • create - create a new user
    • update - update a user
  • sessions
    • create - create a new session

Add more queries and mutations

The project is using GraphQL and Apollo Server. The GraphQL schema is located at src/graphql/schema.gql. Here you will find an empty Query and Mutation type. The actual GraphQL types are located at src/graphql/types. Here you'll find one directory for each type and inside each directory you'll find the .gql file with the type definition. Each type extends either the Query or Mutation type in order to add its specific queries and mutations.

The resolvers are located at src/graphql/resolvers. Here you'll find one directory for each type and inside each directory you'll find the index.ts file with the resolvers for the type. Each resolver is a function that receives the parent, the arguments and the context and returns the result of the resolver.

api-university's People

Contributors

melokki avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.