Skip to content
New issue

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

Adding Strawberry support #44

Merged
merged 13 commits into from
Dec 22, 2022
Merged

Adding Strawberry support #44

merged 13 commits into from
Dec 22, 2022

Conversation

jhnnsrs
Copy link
Owner

@jhnnsrs jhnnsrs commented Dec 15, 2022

adds query, subcsription and mutation as well as object type and interface creation for strawberry types
out of a gql schema

@jhnnsrs jhnnsrs changed the title initial commit Adding Strawberry support Dec 15, 2022
@jhnnsrs jhnnsrs mentioned this pull request Dec 15, 2022
@codecov
Copy link

codecov bot commented Dec 17, 2022

Codecov Report

Base: 93.14% // Head: 93.63% // Increases project coverage by +0.48% 🎉

Coverage data is based on head (b6d331f) compared to base (b2031ca).
Patch coverage: 91.16% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #44      +/-   ##
==========================================
+ Coverage   93.14%   93.63%   +0.48%     
==========================================
  Files          48       54       +6     
  Lines        2321     2874     +553     
==========================================
+ Hits         2162     2691     +529     
- Misses        159      183      +24     
Impacted Files Coverage Δ
turms/plugins/fragments.py 97.02% <ø> (+13.86%) ⬆️
turms/run.py 86.82% <66.66%> (+5.71%) ⬆️
turms/processors/merge.py 84.51% <84.51%> (ø)
turms/plugins/enums.py 95.65% <85.71%> (-4.35%) ⬇️
turms/plugins/strawberry.py 90.67% <90.67%> (ø)
tests/test_complete_generation.py 100.00% <100.00%> (ø)
tests/test_env.py 100.00% <100.00%> (ø)
tests/test_funcs_no_collapse.py 100.00% <100.00%> (ø)
tests/test_merge_processor.py 100.00% <100.00%> (ø)
tests/test_project_pipeline.py 100.00% <100.00%> (ø)
... and 12 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@jhnnsrs
Copy link
Owner Author

jhnnsrs commented Dec 17, 2022

example graphql config to use the news plugin with:

projects:
  default:
    schema: https://countries.trevorblades.com/
    extensions:
      turms:
        skip_forwards: true
        out_dir: examples/countries-code/api
        stylers:
          - type: turms.stylers.capitalize.CapitalizeStyler
          - type: turms.stylers.snake_case.SnakeCaseStyler
        plugins:
          - type: turms.plugins.strawberry.StrawberryPlugin # generates a strawberry schema
        processors:
          - type: turms.processors.disclaimer.DisclaimerProcessor
          - type: turms.processors.black.BlackProcessor
          - type: turms.processors.isort.IsortProcessor
          - type: turms.processors.merge.MergeProcessor # merges the old with new schema
        scalar_definitions:
          uuid: str
          _Any: typing.Any

In this setting with the MergeProcessor you can easily add functionality to your generated file directly. Turms will only affect the fields and arguments of your queries and types, when the schema changes.

@jhnnsrs jhnnsrs merged commit bf4f84b into master Dec 22, 2022
@jhnnsrs jhnnsrs deleted the add-strawberry-plugin branch December 22, 2022 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant