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

Abstraction for proxy server #33

Open
rafalp opened this issue Jul 20, 2023 · 0 comments
Open

Abstraction for proxy server #33

rafalp opened this issue Jul 20, 2023 · 0 comments
Labels
prio: low Low priority

Comments

@rafalp
Copy link
Contributor

rafalp commented Jul 20, 2023

Current API for proxy server definition is quite complex and requires devs to remember a bunch of things when defining a server. We could provide alternative abstraction to make this simpler.

For example:

from ariadne_graphql_proxy.proxy import CachePolicy, ForeignKey, GraphQLProxy, RemoteSchema, LocalSchema


app = GraphQLProxy(
  schemas=[
    RemoteSchema(url="https://example.com", exclude=...),
    LocalSchema(schema),
  ],
  foreign_keys={
    "Mutation": {
      "checkoutComplete": ForeignKey(key=["id"], resolver=ForeignKeyResolver(...))
    }
  },
  cache={
    "Query": {
      "products": CachePolicy(ttl=3600),
    }
  }
)
@rafalp rafalp added the prio: low Low priority label Jul 20, 2023
@rafalp rafalp changed the title Factory function for proxy server Abstraction for proxy server Jul 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
prio: low Low priority
Projects
None yet
Development

No branches or pull requests

1 participant