Comments (26)
Hey, sorry for being passive about this I've been entangled by some work stuff. I'll push my version of code so far at this repository, you can run a test from the ./tests/cli/test_import_schema.py
there are some test gql files in the ./tests/cli/helpers/type
which you can change through the SPECIFIC_TYPE
and SPECIFIC_SCHEMA
constants in the test file. The resulting output should be located in the tests/cli/helpers/output
. All the work done in this was some months ago so I need to browse it a bit to remember... I'll be joining the discord chanell tomorrow so we can chat about it there!
P.S.
Be gentle, it's my first contribution :)
from strawberry.
@patrick91 I want to work on this. How to get started on this?
from strawberry.
@Jatinbalodhi96 I'll assign you to this issue :)
We have a small contribution guide here: https://github.com/strawberry-graphql/strawberry/blob/master/CONTRIBUTING.md#contributing-to-code
We also have a cli setup (which should be refactored I reckon): https://github.com/strawberry-graphql/strawberry/blob/master/strawberry/cli/__init__.py
So maybe you can start from that, what do you think?
from strawberry.
thanks, @patrick91 I followed the guide but while running I faced two errors:
- -
poetry run pytest tests
it gives meModuleNotFoundError: No module named 'termios'
error, after searching figure out that this library is for Linux only. -
Whileimport strawberry
I gotno Module named 'graphql'
even I already ran poetry install which ran. - Unable to install graphql by running
poetry add graphql
gettingbuilding 'graphql_ext' extension error: unknown file type '.pyx' (from 'graphql/graphql_ext.pyx')
error
from strawberry.
@Jatinbalodhi96 uh, never seen that error, what os and python version are using?
from strawberry.
I'm using python 3.7 on windows 10, Now I'm able to run
- I'm able run strawberry now but i installed graphql seperately using
pipenv install --pre "graphql-core>=3a"
The error I sent earlier was because I was installing graphql using poetry add graphql
, I'm not sure if it works same for all.
from strawberry.
@Jatinbalodhi96 oh interest, I never tried strawberry or event GraphQL core on windows, I'll see if I can add tests for that, I don't have a windows machine at the moment, so it might take me a while to test this :)
from strawberry.
@patrick91 I've never used poetry before but is this correct way to build the dev version.
because I'm unable to run strawberry cli, but able to import strawberry.
from strawberry.
@Jatinbalodhi96 yes :)
can you try with
poetry run strawberry
?
from strawberry.
@patrick91 thanks this command run cli, but also I'm unable to import strawberry if I'm outside the directory, so like we do with pip for dependency installation pip install -e .
from strawberry.
@Jatinbalodhi96 yes, poetry works a bit differently than pip, here's the docs on add: https://poetry.eustace.io/docs/cli/#add
do use it like pip install -e .
you need another poetry project as far as I understand :)
from strawberry.
Hey, I'm interested in working on this too, this would be my first contribution ever...
Is it possible for two people to be working the same issue?
from strawberry.
@srbiotik no one is working on this at the moment, feel free to try! Ping me if you need some help 😉
from strawberry.
@patrick91 Thanks a bunch, can't wait to sink my teeth into this!
from strawberry.
@patrick91 Hey, I'm implementing an optional recursive parameter for resolving import statements. This would allow for large schemes to be split up into files and still get parsed without calling the command multiple times. What do you think about this?
from strawberry.
@srbiotik large graphql schemas? that's interesting!
Personally I'd focus on being able to import a whole schema (even if it is one single file) and then add the support for import statements :)
from strawberry.
@patrick91 I'm working on distinguishing required fields from optional.
I approached the problem by comparing swapi graphql schema and split it into files which are located at tests/cli/helpers
folder, since I can compare my output to the your swapi repository. There is one thing that kind of bugs me, why do some optional fields have = None
and others not?
When I look at the SDL there is no difference between them, although I see you made the swapi some 10 months ago so it's possible there has been some change in the SDL since then.
from strawberry.
The swapi repository I've worked on is quite outdated 😊
Anyway, the main reason there's = None
in some places is because dataclasses don't set a default value for the field passed as optional:
It shouldn't make a difference for the SDL though, regarding SDL to Strawberry types, maybe we can put an option that adds = None
to optional fields?
from strawberry.
Sure no problem, already implemented that, I'm wondering though about the description of the optional field. If a field has a description doesn't it need :
= strawberry.field( name="originalFieldName", description="Some clear description.")
Further more, I think i should add a name argument if the snake_case version of the field name differs from the original name.
One more question, in the swapi I never saw an optional field with a custom type
object that has None
assigned to it, is that a preference or a necessity?
What about the strawberry.ID
type is it legal to assign a description to it?
from strawberry.
One more question, in the swapi I never saw an optional field with a custom type object that has None assigned to it, is that a preference or a necessity?
I think it is not have = None
:)
What about the strawberry.ID type is it legal to assign a description to it?
ID is usually self explicatory, but we should be able to do this:
x: strawberry.ID = strawberry.field(description='this is a legacy id')
``
from strawberry.
Hey @patrick91 sorry for not being very active on this for a while, I've been buried at work an life :).
So, I am up to a point where I could use somebody with more xp to look at what I've done so far, so what is the procedure how do present my work so far?
from strawberry.
@srbiotik can you do a PR? we can also chat on discord if you want :) https://discord.gg/ZkRTEJQ
from strawberry.
Hello, I'd be interested in helping with this if you need some peer review
from strawberry.
Hello, I'd be interested in helping with this if you need some peer review
Yeah I need some help with this :). Thanks!
from strawberry.
Do you have your code hosted in github so we can review it together?
from strawberry.
@srbiotik any updates on this? I might need to implement it soon for something I'm working on, don't want to waste your time 😊
from strawberry.
Related Issues (20)
- Support both Pydantic 1 and 2 HOT 1
- Add support for framework's specific upload type
- Schema basics docs HOT 2
- Should we hide fields that starts with `_` by default?
- buggy generic interfaces HOT 3
- Add support of permission_classes for type decorator
- Visual bug in documentation HOT 2
- Allow `strawberry.auto | None` in Pydantic
- strawberry.ext.mypy_plugin PydanticModelField.to_argument error HOT 2
- make to_pydantic function recursive
- Unable to hide field in derived type HOT 1
- Execution Context errors
- Expose common request on extensions' context
- Add support for using FastAPI APIRouter arguments in GraphQLRouter HOT 1
- Feature Request: Info context in scalar serialization HOT 2
- Broken documentation examples in page https://strawberry.rocks/docs/guides/dataloaders HOT 6
- `print_schema` does not prefix the `extend` keyword when Schema uses apollo federation HOT 3
- Property variable_values from class Info returning wrong information HOT 12
- Improve how we find concrete type for generic in interfaces (and potentially unions)
- Add better support for nested generics
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from strawberry.