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

Add azure functions examples to docs v2 #2130

Closed
ErickWendel opened this issue Dec 23, 2018 · 3 comments
Closed

Add azure functions examples to docs v2 #2130

ErickWendel opened this issue Dec 23, 2018 · 3 comments

Comments

@ErickWendel
Copy link
Contributor

At the deployment section the azure examples was only at the v1. Now we need to create the new docs at v2 adding azure code samples.

I’m working now at this, I’ll put here my pull request later

@galvesribeiro
Copy link

Hello @ErickWendel

I've saw your PR on the docs and I've followed it. It looks similar to what is explained on the package's README.md https://www.npmjs.com/package/apollo-server-azure-functions

So far I have it running, but when I try to set the context object like this:

const server = new ApolloServer({
  typeDefs,
  resolvers,
  context: ({ req }) => {
    const token = req.headers.authorization || '';

    const user = { token: token }; //Just being dumb

    return { user };
  }
});
export default server.createHandler({
  cors: {
    origin: true,
    credentials: true,
  }
});

I get that req is undefined. Can you update your PRs to elaborate on how are we supposed to get the function parameters?

Thank you!

@galvesribeiro
Copy link

Sorry... I think I think I've created the issue before dig further... if I change from ({ req }) => ... to ({ request }) => ... it works!

Perhaps you could add it to the docs.

Thanks anyway!

@trevorblades
Copy link
Contributor

Our docs now have some instructions around deploying a server to Azure Functions: https://www.apollographql.com/docs/apollo-server/deployment/azure-functions/

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 21, 2023
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