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

Support mapping graphql resolvers to specific endpoints. #1330

Open
notadamking opened this issue May 1, 2023 · 0 comments
Open

Support mapping graphql resolvers to specific endpoints. #1330

notadamking opened this issue May 1, 2023 · 0 comments

Comments

@notadamking
Copy link

While GraphQL traditionally has a single entry point for all Queries and Mutations, REST usually organizes both across routes. For example, the following GraphQL Schema:

type Query {
   user(id: string): User
   userPermissions(userId: string): UserPermissions
}

type Mutation {
   updateUserPermissions(userId: string, permissions: UserPermissions): UserPermissions
}

would traditionally be implemented in REST in the following routes:

  • `GET /users/:id``
  • GET /users/:id/permissions
  • POST /users/:id/permissions

but this sort of organization of REST routes seems to currently be impossible, leading to undesired rest routes such as :

  • `GET /users``
  • GET /userPermissions
  • POST /userPermissions

which seems fine at first, but not as the API surface area grows and organization of routing becomes very important.

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

No branches or pull requests

1 participant