You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mport{createYoga}from'graphql-yoga'constyoga=createYoga<SomeContext>()exportasyncfunctionserveGraphQLRequest(req: WhatEverRequestEncoreGives,ctx: SomeContext)->WhateverResponseEncoreExpects{constresponse=awaityoga.fetch(req.url,{method: req.method,headers: req.headers,body: req.body},ctx)constheadersObj=Object.fromEntries(response.headers.entries())// Let's say your environment needs to return something like the below;constencoreResponse: WhateverResponseEncoreExpects={statusCode: response.status,body: response.body,headers: headersObj}returnencoreResponse}exportconstgraphQLApiPoint=api.raw({expose: true,path: "/api/gql",method: "POST"},async(req,resp)=>{returnserveGraphQLRequest(req)// Let the type checker help you. },);
How to implement GraphQL support in Encore?
Take a look at: https://github.com/dotansimha/graphql-yoga
The text was updated successfully, but these errors were encountered: