Questions tagged [strawberry-graphql]

Questions related to usage of Strawberry, a Python Library for creating GraphQL APIs using type hints in Python.

50 questions
0
votes
1 answer

Error 'tuple' object has no attribute 'obs - Python GraphQL Strawberry + FastAPI

I'm starting a graphql project where I'm creating an API to get data from an Informix database. I've managed to get everything working but I can't get any results and instead I get the error 'tuple' object has no attribute 'obs Any help would be…
Carlos
  • 21
  • 4
0
votes
1 answer

Problem combining FastAPI dependency and Strawberry GraphQL context

I am struggling to get a certain type of dependency to work with FastAPI and Strawberry GraphQL, specifically with establishing a context. My service contains both a GraphQL route and other types of routes and the following works just…
MWood
  • 68
  • 10
0
votes
1 answer

How can I reduce the number of database queries for a one to many association in Strawberry GraphQL and FastAPI?

I'm developing a python GraphQL API server using FastAPI and Strawberry, and I'm implementing this feature: I have two entities, User and Order, which have a one to many association (a User can have many Orders, an Order can only have one User), and…
0
votes
1 answer

Annotate return type in Strawberry GraphQL Query

@strawberry.field(description="description of query") def sample_query(arg1: Annotated[str, strawberry.argument(description="description of arg1")]) -> list[str]: ... How do I annotate the output with a description? This was the PR that allowed…
joshp
  • 706
  • 5
  • 22
-1
votes
1 answer

Cannot import name 'GraphQL' from 'strawberry.fastapi'

I am trying to run an strawberry example from this tutorial but it does not work. I have the code: from fastapi import FastAPI import strawberry from strawberry.fastapi import GraphQL @strawberry.type class Book: title: str author: str …
KansaiRobot
  • 7,564
  • 11
  • 71
  • 150
1 2 3
4