GithubHelp home page GithubHelp logo

matteodem / graphqlizer Goto Github PK

View Code? Open in Web Editor NEW
37.0 37.0 1.0 196 KB

Make your meteor mongo collections accessible over a graphql endpoint

Home Page: https://atmospherejs.com/easy/graphqlizer

License: GNU Affero General Public License v3.0

JavaScript 100.00%
apollo atmospherejs graphql meteor package

graphqlizer's Introduction

graphqlizer's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

geppadee

graphqlizer's Issues

Refactor into mixins + create search mixin pkg

Allow to pass mixins (or some other naming) to extend graphqlize resolvers and type defs. Also refactor CRUD to be mixins (one for create, one for read etc).

Make the search mixin a separate package and provide some simple default mongo search query.

import { createCollectionSchema } from 'meteor/easy:graphqlizer'
import { searchMixin } from 'meteor/graphqlizer:search'

createCollectionSchema({ 
  type: 'Alien',
  collection: AlienCollection,
  schema: AlienSimpleSchema,
  mixins: [searchMixin],
})
const createMixin = {
  Mutation: {
  },
  typeDefs: `
extend type Mutation {
  ...
}
`
}

Verify if the config structure still makes sense with mixins. Probably deprecate crud config

Allow to register singular types

Something like

import moment from 'moment'
import { registerType } from 'meteor/easy:graphqlizer'

registerType(Date, {
  type: 'Date',
  resolve: field => moment(field),
})

This allows to define custom types that map a simple schema type to a graphql type.

Custom fields

Describe how to customize input / type fields for graphql resolvers + type defs

Relationships

Describe how relationships between types can be handled

Adjust API

So that incrementally changing from graphqlizer CRUD to more complex schemas doesn't result in unreadable code. Also eliminate graphqlContext.

https://gist.github.com/matteodem/9afd3b5401a9aa0127f3cf459a6a0b1a

TODO

  • Add tests
  • Add new API methods (crud, resolvers, resolver, typeDefs, typeDef)
  • Remove package-lock.json from repo (gitignore)
  • Throw deprecation warnings when using old methods
  • Add registerType method (see #10)
  • Create MIGRATE-1.0.md file that explains how to upgrade
  • Update docs
  • Remove old docs
  • Release v0.* with deprecating warnings
  • Update graphqlizer-test-app
  • Use new API in Sounds Social
  • Include carbon image in README and link it to github gist
  • Remove old methods / tests
  • Use simpl-schema npm package instead of atmosphere pkg
  • Release v1.0 with warnings
  • Announce release

Final tests

  • Create test for generateTypeDefsAndResolvers method
  • Use in own apps
  • How to instantiate empty initial Query and Mutation?

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.