Coder Social home page Coder Social logo

federation-nexus-prisma's Introduction

GraphQL Apollo Federation, Prisma and Nexus-Schema

This example is an GraphQL server implementation in TypeScript using Apollo Federation, Prisma and Nexus-Schema. It uses Postgres database.

How to use

1. Download and install dependencies

Clone this repository:

git clone [email protected]:ricardoalmeida/federation-nexus-prisma.git

Install yarn dependencies:

cd federation-nexus-prisma
yarn install

2. Start Postgres via Docker

docker-compose up -d

3. Run db migrations

yarn prisma:migrate

4. Start Service and Gateway

Vitrola (Service)

yarn dev

Gateway Server

yarn gateway

The GraphQL Playground is available in http://localhost:4000/graphql.

Using the GraphQL API

Try it out!

mutation createTrack {
  createOneTrack(data: { name: "Favorite Track" }) {
    id
    name
  }
}

mutation createPlaylist {
  createOnePlaylist(data: { description: "My playlist" }) {
    id
  }
}

query playlists {
  playlists {
    id
    description
    tracks {
      id
    }
  }
}

query playlist {
  playlist(where: { id: 1 }) {
    id
    tracks {
      id
    }
  }
}

Development

If you use VSCode, install plugin for Prisma: https://marketplace.visualstudio.com/items?itemName=Prisma.prisma

Integration tests

GraphQL queries and mutations are using Postgres for an integration test validation. So make sure you have the db up and running.

yarn postgres:start
yarn test

Authentication & Authorization

The Gateway authenticates the user (TODO) and send proper headers to the service. The service uses graphql-shield to verify permissions.

federation-nexus-prisma's People

Contributors

renovate-bot avatar ricardoalmeida avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

simonzsolt89

federation-nexus-prisma's Issues

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Error type: undefined. Note: this is a nested preset so please contact the preset author if you are unable to fix it yourself.

Dependency Dashboard

This issue provides visibility into Renovate updates and their statuses. Learn more

Rate Limited

These updates are currently rate limited. Click on a checkbox below to force their creation now.

  • Update actions/setup-node action to v3

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.


  • Check this box to trigger a request for Renovate to run again on this repository

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.