All Projects → graphql-python → Graphene Mongo

graphql-python / Graphene Mongo

Licence: mit
Graphene MongoEngine integration

Programming Languages

python
139335 projects - #7 most used programming language

Labels

Projects that are alternatives of or similar to Graphene Mongo

Django Graphql Auth
Django registration and authentication with GraphQL.
Stars: ✭ 200 (-5.66%)
Mutual labels:  graphql
Lighthouse
A framework for serving GraphQL from Laravel
Stars: ✭ 2,685 (+1166.51%)
Mutual labels:  graphql
Graphiql Workspace
A graphical interactive in-browser GraphQL IDE enhanced with tabbed navigation, HTTP headers, arbitrary endpoints, etc.
Stars: ✭ 209 (-1.42%)
Mutual labels:  graphql
Reason Urql
Reason bindings for Formidable's Universal React Query Library, urql.
Stars: ✭ 203 (-4.25%)
Mutual labels:  graphql
Go Graphql Starter
This repository uses graph-gophers/graphql-go to build a starter web application
Stars: ✭ 204 (-3.77%)
Mutual labels:  graphql
Bit
A tool for component-driven application development.
Stars: ✭ 14,443 (+6712.74%)
Mutual labels:  graphql
Djangochannelsgraphqlws
Django Channels based WebSocket GraphQL server with Graphene-like subscriptions
Stars: ✭ 203 (-4.25%)
Mutual labels:  graphql
Cookiecutter Django Vue Graphql Aws
A highly opinionated Cookiecutter template that fuses together Django, Vue.js, GraphQL, and AWS into one full-stack web application.
Stars: ✭ 213 (+0.47%)
Mutual labels:  graphql
Mongoke
Instant Graphql for MongoDb (active branch is golang, rewrite in process)
Stars: ✭ 203 (-4.25%)
Mutual labels:  graphql
Absinthe plug
Plug support for Absinthe, the GraphQL toolkit for Elixir
Stars: ✭ 209 (-1.42%)
Mutual labels:  graphql
The Road To Graphql
📓The Road to GraphQL: Your journey to master pragmatic GraphQL in JavaScript
Stars: ✭ 203 (-4.25%)
Mutual labels:  graphql
Graphql Camara Deputados
API GraphQL com os dados da câmara de deputados do Brasil
Stars: ✭ 204 (-3.77%)
Mutual labels:  graphql
React Native Fullstack Graphql
🚀 Starter projects for mobile applications based on React Native & GraphQL.
Stars: ✭ 208 (-1.89%)
Mutual labels:  graphql
Graphql Doctor
Prevent Breaking Changes in a GraphQL API with GitHub Checks
Stars: ✭ 203 (-4.25%)
Mutual labels:  graphql
Mercure
Server-sent live updates: protocol and reference implementation
Stars: ✭ 2,608 (+1130.19%)
Mutual labels:  graphql
Magellan
Real-time streaming GraphQL server for Go.
Stars: ✭ 202 (-4.72%)
Mutual labels:  graphql
Taskcafe
An open source project management tool with Kanban boards
Stars: ✭ 2,848 (+1243.4%)
Mutual labels:  graphql
Margarita
[not actively maintained] Mobile and Web application implementing Kiwi.com Tequila API
Stars: ✭ 213 (+0.47%)
Mutual labels:  graphql
Graphene File Upload
Enhances Graphene Django GraphQL Server for intuitive file uploads via GraphQL mutations.
Stars: ✭ 210 (-0.94%)
Mutual labels:  graphql
36 Graphql Concepts
📜 36 concepts every GraphQL developer should know.
Stars: ✭ 209 (-1.42%)
Mutual labels:  graphql

Build Status Coverage Status Documentation Status PyPI version PyPI pyversions Downloads

Graphene-Mongo

A Mongoengine integration for Graphene.

Installation

For installing graphene-mongo, just run this command in your shell

pip install graphene-mongo

Examples

Here is a simple Mongoengine model as models.py:

from mongoengine import Document
from mongoengine.fields import StringField

class User(Document):
    meta = {'collection': 'user'}
    first_name = StringField(required=True)
    last_name = StringField(required=True)

To create a GraphQL schema for it you simply have to write the following:

import graphene

from graphene_mongo import MongoengineObjectType

from .models import User as UserModel

class User(MongoengineObjectType):
    class Meta:
        model = UserModel

class Query(graphene.ObjectType):
    users = graphene.List(User)
    
    def resolve_users(self, info):
    	return list(UserModel.objects.all())

schema = graphene.Schema(query=Query)

Then you can simply query the schema:

query = '''
    query {
        users {
            firstName,
            lastName
        }
    }
'''
result = schema.execute(query)

To learn more check out the following examples:

Contributing

After cloning this repo, ensure dependencies are installed by running:

pip install -r requirements.txt

After developing, the full test suite can be evaluated by running:

make test
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].