Skip to content
This repository has been archived by the owner on Aug 16, 2024. It is now read-only.

Metadata HTTP forwarding #81

Open
FrancoisChastel opened this issue Aug 7, 2019 · 3 comments
Open

Metadata HTTP forwarding #81

FrancoisChastel opened this issue Aug 7, 2019 · 3 comments

Comments

@FrancoisChastel
Copy link

Hello All !

I am currently planning to use rejoiner for exposing a single HTTP endpoint for a public API on one of my project.

In this context, I need to be able to retrieve the usual metadata which is inside an HTTP request (user-agent,etc...).

After looking quickly in the code I couldn't find any mention of it in the codebase.

  • Does rejoiner forward the HTTP metadata to the gRPC metadata ?
@sheepdreamofandroids
Copy link
Contributor

sheepdreamofandroids commented Aug 15, 2019

Rejoiner doesn't. It cannot know what metadata is important to you and how it should be transmitted.

But in your endpoint, which can be a standard servlet, you can collect any metadata you like into an object of your choice and stick it into the ExecutionInput as "context". This context is available in any @Query or @SchemaModification annotated method from the DataFetchingEnvironment parameter.

@siderakis
Copy link
Member

@FrancoisChastel Did that answer you question? How would you like it to work? Is there something we can automate?

@FrancoisChastel
Copy link
Author

@siderakis I think having in the query in the gRPC-side something like a context object in the proto-definition of the services which contains the usual HTTP metadata as mentioned would be a great improvement, we could have a seamless experience of the rejoiner integration with the HTTP-Rest "world"

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants