Commit b1f3c57
committed
Support class-style contexts in sqlalchemy mapper, a la fastapi style.
https://strawberry.rocks/docs/integrations/fastapi shows two ways to implement
contexts -- dictionary style, as is currently supported in this mapper, and
class style, which is more idiomatic in fastapi and results in a "not subscritable"
error in the current mapper implementation.
I much prefer modifying the mapper to support both styles, but if this is
something you'd rather not add, I can in theory implement __getitem__
on my custom context and it'll work just fine.
Re: tests, I couldn't find any existing tests that actually test
the mapper end-to-end with a real postgres database and server.
I would be happy to write an integration test of sorts that uses
postgresql and fastapi and tests the mapper end-to-end, just let me know.1 parent ba50ae3 commit b1f3c57
1 file changed
+5
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
413 | 413 | | |
414 | 414 | | |
415 | 415 | | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
416 | 420 | | |
417 | | - | |
| 421 | + | |
418 | 422 | | |
419 | 423 | | |
420 | 424 | | |
| |||
0 commit comments