Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@midgar/apollo-server

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@midgar/apollo-server

A Midgar plugin to add graphql server

  • 1.0.0-alpha.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Build Status Coverage

@midgar/apollo-server

Système de services avec injection de dépendance pour Midgar

Installation

$ npm i @midgar/apollo-server --save

Si tout s'est bien passé, un message de confirmation s'affiche:

#midgar-cli
@midgar/apollo-server added to plugins.js !

Fonctionnement

Ajoute un dossier de plugin midgar-graphql: ./graphql/.

Fichier grapql

Un fichier graphql contient les typeDefs et les resolvers graphql. exemple d'un fichier graphl:

const { gql } = require('apollo-server-express')

const typeDefs = gql`
  type User {
    id: ID!
    email: String!
  }

  extend type Query {
    addUser(email: String): User
    getUsers: [User]
  }
`

const typeDefs = (mid) => {
  const users = []
  return {
    User: {
     ...
    }
    Query: {
      getUsers: (parent, args, ctx, info) => {
        ...
      },
      addUser: async (parent, args, ctx, info) => {
        ...
      }
    }
  }
}

export default {
  typeDefs,
  resolvers
}

Vous pouvez séparrer le fichier si besoin:

import typeDefs from './user.typedefs'
import resolvers from './user.resolvers'

export default {
  typeDefs,
  resolvers
}

Les fichiers *.typedefs.js et *.resolvers.js ne sont pas importé lors de l'import des fichiers graphql.

Keywords

FAQs

Package last updated on 05 Jan 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc