We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
-
As per title. Would be great if we had one model that could work with pydastic and strawberry queries. Maybe I'm naïve....
I would want execute strawberry and pydastic queries/insertions on a SQLModel.
Asking the same in the the strawberry and pydastic repos. Creating a new project to incorporate all 3....
Windows
Windows 11 home
0.0.8
3.10
strawberry-graphql/strawberry#1183
Might be some code/additional context here.
The text was updated successfully, but these errors were encountered:
from sqlmodel import SQLModel, Field from strawberry import schema, ID
class Item(SQLModel, table=True): id: int = Field(default=None, primary_key=True) name: str
class ItemPydantic(BaseModel): name: str
@Schema class ItemSchema: id: ID name: str
@strawberry.type class Query: @strawberry.field def get_item(self, id: int) -> ItemSchema: item = get_item_by_id(id) # Implement this function return ItemSchema(id=item.id, name=item.name)
@strawberry.type class Mutation: @strawberry.mutation def create_item(self, name: str) -> ItemSchema: item = create_item(name) # Implement this function return ItemSchema(id=item.id, name=item.name)
Sorry, something went wrong.
No branches or pull requests
First Check
Commit to Help
Example Code
-
Description
As per title. Would be great if we had one model that could work with pydastic and strawberry queries. Maybe I'm naïve....
Wanted Solution
I would want execute strawberry and pydastic queries/insertions on a SQLModel.
Wanted Code
-
Alternatives
Asking the same in the the strawberry and pydastic repos.
Creating a new project to incorporate all 3....
Operating System
Windows
Operating System Details
Windows 11 home
SQLModel Version
0.0.8
Python Version
3.10
Additional Context
strawberry-graphql/strawberry#1183
Might be some code/additional context here.
The text was updated successfully, but these errors were encountered: