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

feat: allow ability to add global dependencies #110

Merged
merged 2 commits into from
Oct 7, 2024

Conversation

rzlim08
Copy link
Collaborator

@rzlim08 rzlim08 commented Oct 3, 2024

  • Allows ability to add global dependencies to web app

@rzlim08 rzlim08 requested a review from jgadling October 3, 2024 21:31
@@ -50,7 +50,7 @@ def get_graphql_name(self, obj: HasGraphQLName) -> str:
return super().get_graphql_name(obj)


def get_app(settings: APISettings, schema: strawberry.Schema, db_module: typing.Any) -> FastAPI:
def get_app(settings: APISettings, schema: strawberry.Schema, db_module: typing.Any, dependencies: typing.Optional[typing.Sequence[Depends]] = []) -> FastAPI:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just out of curiosity, what are these global dependencies? Would they be any better represented as middlewares?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

basically to check auth tokens. I first wrote this as middleware but it was suggested to me that a dependency might be for that.

@rzlim08 rzlim08 merged commit 90bb9b6 into main Oct 7, 2024
4 checks passed
@rzlim08 rzlim08 deleted the rlim/add-global-dependencies branch October 7, 2024 21:52
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.

2 participants