robzsk / serverless-plugin-graphiql

Creates http endpoints for graphql server with graphiql
54 stars 7 forks source link

TypeError: Request path contains unescaped characters #4

Open cdelgadob opened 7 years ago

cdelgadob commented 7 years ago

Hi, first thanks for this plugin, I will be using it frequently as soon as I can make it work :)

I can install and launch the plugin, but when I hit the URL, I get this error in the serverless console:

TypeError: Request path contains unescaped characters
    at new ClientRequest (_http_client.js:86:13)
    at Object.request (http.js:26:10)
    at forwardRequestToNodeServer (/Volumes/SDDExt/mygraphql/mygraphql-server/node_modules/aws-serverless-express/index.js:104:22)
    at Server.startServer.on (/Volumes/SDDExt/mygraphql/mygraphql-server/node_modules/aws-serverless-express/index.js:154:21)
    at emitNone (events.js:91:20)
    at Server.emit (events.js:188:7)
    at emitListeningNT (net.js:1291:10)
    at _combinedTickCallback (internal/process/next_tick.js:77:11)
    at process._tickDomainCallback (internal/process/next_tick.js:128:9)
/Volumes/SDDExt/mygraphql/mygraphql-server/node_modules/aws-serverless-express/index.js:99
    context.succeed(errorResponse)
            ^

TypeError: context.succeed is not a function
    at forwardLibraryErrorResponseToApiGateway (/Volumes/SDDExt/mygraphql/mygraphql-server/node_modules/aws-serverless-express/index.js:99:13)
    at Server.startServer.on (/Volumes/SDDExt/mygraphql/mygraphql-server/node_modules/aws-serverless-express/index.js:156:21)
    at emitNone (events.js:91:20)
    at Server.emit (events.js:188:7)
    at emitListeningNT (net.js:1291:10)
    at _combinedTickCallback (internal/process/next_tick.js:77:11)
    at process._tickDomainCallback (internal/process/next_tick.js:128:9)

I'm using both parameters to configure the plugin: port and function.

It it running on nodejs 6.10

Carlos

bencooling commented 7 years ago

Hi Carlos,

I hope we can get it working for you! From your stack trace it looks like you are using aws-serverless-express for your http server. This plugin is intended to be used as a local http server for serverless. I would recommend getting the example up and running and then introduce aws-serverless-express into your project and see if it can make a HTTP request to the example graphql server.

Thanks, Ben