Skip to content
Discussion options

You must be logged in to vote

You can now do this using a custom predicate function (supported for both HTTP and GraphQL):

function action(actionName: string) {
  return ({ request }) => {
    const url = new URL(request.url)
    return url.searchParams.get(actionName) != null
  }
}

http.post(action('createUser'), resolver)
http.put(action('updateUser'), resolver)

Read more:

Replies: 3 comments 4 replies

Comment options

You must be logged in to vote
3 replies
@lubiah
Comment options

@lubiah
Comment options

@kettanaito
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@lubiah
Comment options

Answer selected by kettanaito
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
2 participants
Converted from issue

This discussion was converted from issue #2572 on August 28, 2025 13:00.