All Projects → julienvincent → Modelizr

julienvincent / Modelizr

Generate GraphQL queries from models that can be mocked and normalized.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Modelizr

Locksmith
Want to use GraphQL with Clojure/script but don't want keBab or snake_keys everywhere? Use locksmith to change all the keys!
Stars: ✭ 59 (-66.29%)
Mutual labels:  graphql, graphql-client
Angular1 Apollo
AngularJS integration for the Apollo Client
Stars: ✭ 108 (-38.29%)
Mutual labels:  graphql, graphql-client
Android Okgraphql
Reactive GraphQl client for Android
Stars: ✭ 64 (-63.43%)
Mutual labels:  graphql, graphql-client
Graphql Kotlin
Libraries for running GraphQL in Kotlin
Stars: ✭ 1,030 (+488.57%)
Mutual labels:  graphql, graphql-client
Graphql Hooks
🎣 Minimal hooks-first GraphQL client
Stars: ✭ 1,610 (+820%)
Mutual labels:  graphql, graphql-client
Graphql Query Test Mock
Easily mock GraphQL queries in your Relay Modern / Apollo / any-other-GraphQL-client tests.
Stars: ✭ 49 (-72%)
Mutual labels:  graphql, graphql-client
Nuxt Graphql Request
Easy Minimal GraphQL client integration with Nuxt.js.
Stars: ✭ 85 (-51.43%)
Mutual labels:  graphql, graphql-client
Kikstart Graphql Client
🚀 Small NodeJS Wrapper around apollo-client that provides easy access to running queries, mutations and subscriptions.
Stars: ✭ 27 (-84.57%)
Mutual labels:  graphql, graphql-client
Qlens
QLens is an electron app which dynamically generates GraphQL Schemas and Mongo Schema visualization. QLens significantly cuts development time by automating the formation of their GraphQL schemas based on information fetched from their non-relational database.
Stars: ✭ 110 (-37.14%)
Mutual labels:  graphql, graphql-client
Apollo Link
🔗 Interface for fetching and modifying control flow of GraphQL requests
Stars: ✭ 1,434 (+719.43%)
Mutual labels:  graphql, graphql-client
Magiql
🌐 💫 Simple and powerful GraphQL Client, love child of react-query ❤️ relay
Stars: ✭ 45 (-74.29%)
Mutual labels:  graphql, graphql-client
Client Side Graphql
Stars: ✭ 119 (-32%)
Mutual labels:  graphql, graphql-client
Graphql Client
A Ruby library for declaring, composing and executing GraphQL queries
Stars: ✭ 961 (+449.14%)
Mutual labels:  graphql, graphql-client
Apollo Angular
A fully-featured, production ready caching GraphQL client for Angular and every GraphQL server 🎁
Stars: ✭ 1,058 (+504.57%)
Mutual labels:  graphql, graphql-client
Fullstack Graphql
🌈 Simple Fullstack GraphQL Application. API built with Express + GraphQL + Sequelize (supports MySQL, Postgres, Sqlite and MSSQL). WebApp built with React + Redux to access the API. Written in ES6 using Babel + Webpack.
Stars: ✭ 955 (+445.71%)
Mutual labels:  graphql, graphql-client
Cynic
A bring your own types GraphQL client library for Rust
Stars: ✭ 68 (-61.14%)
Mutual labels:  graphql, graphql-client
Gql
A GraphQL client in Python
Stars: ✭ 681 (+289.14%)
Mutual labels:  graphql, graphql-client
Aws Mobile Appsync Sdk Js
JavaScript library files for Offline, Sync, Sigv4. includes support for React Native
Stars: ✭ 806 (+360.57%)
Mutual labels:  graphql, graphql-client
Gest
👨‍💻 A sensible GraphQL testing tool - test your GraphQL schema locally and in the cloud
Stars: ✭ 109 (-37.71%)
Mutual labels:  graphql, graphql-client
Graphql Stack
A visual explanation of how the various tools in the GraphQL ecosystem fit together.
Stars: ✭ 117 (-33.14%)
Mutual labels:  graphql, graphql-client

modelizr

Coverage Status Build Status npm version Gitter

A Combination of normalizr, fakerjs and GraphQL that allows you to define multipurpose models that can generate GraphQL queries, mock deeply nested data and normalize

Installation

$ yarn add modelizr

What can I use this for?

  • Easily generating GraphQL queries from models.
  • Flat-mapping responses using normalizr.
  • Mocking deeply nested data that match the structure of a GraphQL query.

Read my medium post on why I wrote modelizr.

What does it look like?

import { Modelizr } from 'modelizr'

const ModelData = {
  Person: {
    normalizeAs: "People",
    fields: {
      id: Number,
      firstName: String,
      Books: ["Book"]
    }
  },
    
  Book: {
    normalizeAs: "Books",
    fields: {
      id: Number,
      title: String,
      Author: "Person"
    }
  }
}

const {query, models: {Person, Book}} = new Modelizr({
  models: ModelData,
  config: {
    endpoint: "http:// ..."
  }
})

query(
  Person({id: 1}
    Book("Books")
  ),
  
  Book("Books", {ids: [4, 5]})
).then((res, normalize) => {
  normalize(res.body) // -> normalized response.
})

This will generate the following query and make a request using it.

{
  Person(id: 1) {
    id,
    firstName,
    Books {
      id,
      title
    }
  },
  
  Books(ids: [4, 5]) {
    id,
    title,
    Author {
      id,
      firstName
    }
  }
}

Documentation

NOTE: Documentation for pre-v1.0.0 can be found Here

All documentation is located at julienvincent.github.io/modelizr

Example

  • $ yarn
  • $ yarn start

navigate to http://localhost:8000 in your browser

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].