npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

feathersql

v1.0.9

Published

> ⚡️ The Feathers and GraphQL Integration.

Downloads

6

Readme

FeathersQL

⚡️ The Feathers and GraphQL Integration.

logo

NPM version

Npm Downloads

queries

Getting Started

You can create a project using feathers-cli. See more details here: https://github.com/feathersjs/cli

Usage Example Projects

With Common JS

https://github.com/hookcompany/feathersql/tree/master/example

With Import/Export and Babel Configuration

https://github.com/hookcompany/feathers-graphql-boilerplate

Installing

Install with npm

$ npm install --save feathersql

Install with Yarn

$ yarn add feathersql

Usage

// services/app1/users/types.gql
const gql = require('graphql-tag');

module.exports = gql`
  input UserFilter {
    id: Any
    name: Any
    birth: Any
    tags: Any
    createdAt: Any
    updatedAt: Any
  }

  input NewUserData {
    name: String!
    birth: Date!
    tags: [String]
  }

  input EditUserData {
    name: String
    birth: Date
    tags: [String]
  }

  input UserUpdateData {
    set: EditUserData
    push: [Any!]
    pull: [Any!]
  }

  type UserQuery @query {
    users(query: UserFilter, sort: Any, limit: Int, skip: Int): [User] @find
    user(id: ID, query: UserFilter): User @get
  }

  type UserMutation @mutation {
    createUser(data: NewUserData!): User @create
    createUsers(data: [NewUserData!]!, sort: Any): [User] @create
    updateUser(id: ID, query: UserFilter, data: UserUpdateData!): User @update
    updateUsers(id: ID, query: UserFilter, data: UserUpdateData!, sort: Any): [User] @update
    patchUser(id: ID, query: UserFilter, data: EditUserData!): User @patch
    patchUsers(id: ID, query: UserFilter, data: EditUserData!, sort: Any): [User] @patch
    removeUser(id: ID, query: UserFilter): User @remove
    removeUsers(id: ID, query: UserFilter, sort: Any): [User] @remove
  }

  type UserSubscription @subscription {
    createUser: [User] @create
    updateUser: [User] @update
    patchUser: [User] @patch
    removeUser: [User] @remove
  }
`;
// services/app1/users/index.js
const types = require('./types');
const hooks = require('./hooks');

module.exports = {
  types,
  hooks,
  modelName: 'User',
  path: '/users',
  filters: {
    CREATED: (payload, args, context) => {
      console.log('users created');
      return true;
    },
    UPDATED: (payload, args, context) => {
      console.log('users updated');
      return true;
    },
    REMOVED: (payload, args, context) => {
      console.log('users removed');
      return true;
    }
  }
};
// services/app1/index.js
const Category = require('./categories');
const Product = require('./products');
const User = require('./users');

module.exports = {
  basePath: '/app1',
  services: [User, Category, Product]
};
// services/index.js
const feathersQL = require('../../../dist');
const models = require('../models');
const app1 = require('./app1');
const app2 = require('./app2');

module.exports = app => {
  feathersQL(models)(app)
    .platform(app1)
    .platform(app2)
    .configure();
};

Configuration

const mongoose = require('mongoose');

module.exports = app => {
  mongoose.connect(app.get('mongodb'));
  mongoose.Promise = global.Promise;
  app.set('mongooseClient', mongoose); // This line is mandatory.
};

Querying

Support

Query
  • eq
  • gt && gte
  • lt && lte
  • in
  • ne && nen
  • exists && not
  • mod
  • regex
  • options
  • size
Sort
  • sort: ["name:desc", "createdAt:asc"]
  • sort: "name:desc createdAt:asc"
  • sort: { name: "desc", createdAt: "asc" }
Limit: Int
Skip: Int

Options

  • mongooseClientVariableName (String) - Mongoose client variable name. ex.: app.set('mongooseClient', mongoose);; default is 'mongooseClient'
  • socketPort (Int) - Subscriptions socket port; default is 5000
  • graphqlEndPoint (String) - GraphQL endpoint; default is '/graphql'
  • subscriptionEndPoint (String) - Subscriptions endpoint; default is '/subscriptions'
  • voyagerEndPoint (String) - Voyager endpoint; default is '/voyager'
  • graphiqlEndPoint (String) - GraphQL IDE endpoint; default is '/graphiql'
  • playgroundEndPoint (String) - Playground(similar to GraphQL IDE) endpoint; default is '/playground'
  • subscription (Bool) - Configure subscriptions; default is true
  • voyager (Bool) - Configure voyager; default is true
  • graphiql (Bool) - Configure GraphQL IDE; default is true
  • playground (Bool) - Configure playground; default is true

Consuming The API

Populate

populate

Subscriptions

subscriptions

License

This project is licensed under the MIT License - see the LICENSE.md file for details.