Code Monkey home page Code Monkey logo

Comments (9)

necaris avatar necaris commented on April 28, 2024 5

FYI @tiangolo (and anyone else who's interested) we just released our Graphene + Pydantic layer which we're using in a FastAPI project: https://pypi.org/project/graphene-pydantic/ -- hope it's helpful for folks!

from fastapi.

tiangolo avatar tiangolo commented on April 28, 2024 4

GraphQL docs are now live at: https://fastapi.tiangolo.com/tutorial/graphql/ πŸŽ‰ πŸš€

from fastapi.

phy25 avatar phy25 commented on April 28, 2024 1

You should be able to search on the doc website but https://fastapi.tiangolo.com/advanced/graphql/

from fastapi.

lfvilella avatar lfvilella commented on April 28, 2024 1

Hello there, inspired on the graphene-pydantic packaged I created the pydantic2graphene, this is a package that allows you to re-use the pydantic schemas that you use on your FastAPI endpoints to also generate graphene objects for your GraphQL endpoint.

You can checkout a full example of re-using schemas to get your REST and GraphQL endpoints running.

https://github.com/lfvilella/pydantic2graphene/tree/master/docs/examples/fastapi_graphql_and_rest

from fastapi.

tiangolo avatar tiangolo commented on April 28, 2024

Yep, it's still missing from the docs.

There are a couple other features that are provided directly by Starlette that I haven't documented yet. And some that I have to update the docs in Starlette directly first.

But I have it planned and I'll add them πŸ˜„


For GraphQL it would depend directly on Graphene, exactly as in Starlette.

I think I might create a Pydantic/Graphene layer latter, to be able to use Python types for GraphQL. I would build it as an external package (so that others outside FastAPI can use it too). But that's more in the mid/long-term.

from fastapi.

rcox771 avatar rcox771 commented on April 28, 2024

thanks @tiangolo. I will definitely be on the lookout for the pydantic type-based stuff. I found a talk given by Alec Macqueen at Europython 2018 where he discusses some work his company was doing internally in this realm (type-annotation qraphql magic). I don't believe they open-sourced anything yet, but he may have some ideas that will help. I pinned the start time for ye for the juicy bits.

video

from fastapi.

tiangolo avatar tiangolo commented on April 28, 2024

Thanks for the video, I finally got to see it. It looks interesting indeed.

from fastapi.

DTrafford avatar DTrafford commented on April 28, 2024

GraphQL docs are now live at: https://fastapi.tiangolo.com/tutorial/graphql/ πŸŽ‰ πŸš€

This link doesn’t work anymore

from fastapi.

github-actions avatar github-actions commented on April 28, 2024

Assuming the original need was handled, this will be automatically closed now. But feel free to add more comments or create new issues or PRs.

from fastapi.

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.