Giter VIP home page Giter VIP logo

Comments (12)

amitsaha avatar amitsaha commented on August 19, 2024

I am working on something: https://github.com/amitsaha/flask-graphql-demo it's really basic but shows off querying, updating existing data and uploading files. I am hoping to keep working on it, feel free to suggest changes/improvements/enhancements.

from graphene.

amitsaha avatar amitsaha commented on August 19, 2024

@syrusakbary is this something you would want to integrate into the source tree as an example? If yes, what would you like to see in it?

from graphene.

syrusakbary avatar syrusakbary commented on August 19, 2024

Hi @amitsaha, I'm willing to create a package for integrating graphql in flask easily (with GraphQL and GraphiQL views). Once is done, yeah... any example will be more than welcome!

Meanwhile I've linked your package in the documentation package (the new version of the website will be released tomorrow):
https://github.com/graphql-python/graphene/blob/docs/docs/pages/community.md

from graphene.

amitsaha avatar amitsaha commented on August 19, 2024

Thanks @syrusakbary - that would be awesome. Do you already have some work done that I can look at?

from graphene.

amitsaha avatar amitsaha commented on August 19, 2024

@syrusakbary just wondering if you have any code that you can share? I would like to integrate graphiql into my project. If you don;'t have any, I will try to set it up somehow .. :)

from graphene.

msoedov avatar msoedov commented on August 19, 2024

@amitsaha I have really simple flask app example https://github.com/msoedov/flask-graphql-example, you can build it from docker-compose and check that out

from graphene.

syrusakbary avatar syrusakbary commented on August 19, 2024

I've created the GraphQL-Flask package for using GraphQL in Flask easily.

Also, you can check the Flask SQLAlchemy in the sqlalchemy branch:
https://github.com/graphql-python/graphene/tree/sqlalchemy/examples/flask_sqlalchemy

This example, with the SQLAlchemy support will be merged soon: #87

from graphene.

amitsaha avatar amitsaha commented on August 19, 2024

Thanks @syrusakbary - will check them out.

from graphene.

sibelius avatar sibelius commented on August 19, 2024

@syrusakbary you should consider using the graffiti approach

To enable adapters for databases.
For now, you already have two of them in contribute django and sqlalchemy, I think the next one could be mongoengine

Thanks for this repository

from graphene.

amitsaha avatar amitsaha commented on August 19, 2024

@syrusakbary it works great. @msoedov Will do, does it support file uploads? My approach is very basic here: https://github.com/amitsaha/flask-graphql-demo/blob/master/schema.py

Would be curious to know if you have a better idea?

from graphene.

command-tab avatar command-tab commented on August 19, 2024

Thanks for your repo, @amitsaha! It cleared up a number of things for me as I'm getting going with graphene :)

from graphene.

vladinator1000 avatar vladinator1000 commented on August 19, 2024

I'm working on an updated flask example, would like to include file uploads but I'm getting this error:
UploadFile fields must be a mapping (dict / OrderedDict) with field names as keys or a function which returns such a mapping.

Using this simple schema:

from graphene import Schema, Argument, String, Int, ObjectType, Mutation

class Query(ObjectType):
	hello = String()

	def resolve_hello(self, info):
		return 'Hello there.'

class UploadFile(Mutation):
	class Arguments:
		pass

	def mutate(self, info):
		return 'test'

class Mutations(ObjectType):
	uploadFile = UploadFile.Field()


schema = Schema(query = Query, mutation = Mutations)

from graphene.

Related Issues (20)

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.