express-graphql | Create a GraphQL HTTP server with Express | Runtime Evironment library
kandi X-RAY | express-graphql Summary
kandi X-RAY | express-graphql Summary
Create a GraphQL HTTP server with any HTTP web framework that supports connect styled middleware, including Connect itself, Express and Restify.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of express-graphql
express-graphql Key Features
express-graphql Examples and Code Snippets
Community Discussions
Trending Discussions on express-graphql
QUESTION
Hi I am following this video to make a booking system enter link description here
And my code is identical to the creator but it isn't running (error message shown below)
...ANSWER
Answered 2022-Apr-14 at 19:45To fix the error TypeError: graphqlHttp is not a function
, replace
QUESTION
I have a mongodb server setup which on running the below command starts on port 3000
...ANSWER
Answered 2022-Mar-10 at 15:08I was able to resolve the main issue by adding the query block inside photos resolver
QUESTION
I've set up a GraphQL server using express-graphql and Restify, which works perfectly on Postman. However, when actually calling it from our frontend we keep getting CORS issues. I've tried just about everything.
The weird thing is that if we remove all headers from the frontend axios request, CORS is no longer an issue - but then we get the "query must be a string" error from graphql.
Full code:
...ANSWER
Answered 2022-Mar-04 at 15:09This isn't very well documented in the restify-cors-middleware2
package, but turns out I need to set the allowCredentialsAllOrigins
and credentials
properties, as well as add a lot more allowHeaders
:
QUESTION
This is reamining part of error -> No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
I am learning Graphql with React js with help of Apollo Client , This is my Server.js Code :-
...ANSWER
Answered 2022-Mar-03 at 05:45As I know, you should give access to the http://localhost:3000
on your backend file.
However, here is the more accurate answer for your question.
Also check the followings out :
CORS issue with using localhost:3000 to access graphql API at a different URL
CORS error: Access to fetch backend to frontend, Graphql (Nodejs, Reactjs)
QUESTION
I am learning GraphQL and I faced an error due while trying to start a server.
...ANSWER
Answered 2022-Feb-17 at 23:04There is syntax confusion. In RootQuery the type part under user completely covers the whole field structure, error is here.
Just remove top level type: {}
.
Try this out:
QUESTION
ANSWER
Answered 2022-Feb-14 at 03:35From their doc
QUESTION
As long as the line with useLazyQuery
in App.js
(code below) is removed, it will display simple "HELLO" message (working well), otherwise, I got the below error message
ANSWER
Answered 2022-Jan-23 at 05:04Delete your node_modules folder(also from the recycle bin)
and run npm install
It worked for me because i had two node_modules folder in the project directory
QUESTION
I'm trying to debug a simple error in NodeJs. Error: Cannot find module './schema/schema'. I tried to create a dummy file with a string and trying to require in my project root and the same error showed up. I tried to delete the folder and the file about 3x and the error persist. Here is my code:
...ANSWER
Answered 2022-Jan-10 at 14:39Your files have a .ts
extension.
It can't find the file because it doesn't have a .js
or .cjs
file extension.
If you're using TypeScript, then use:
import
/export
and notrequire
/modules.exports
and- a typescript compiler
If you're not using TypeScript then use a .js
file extension.
QUESTION
hi I followed a tutorial for GraphQL, that is the code I wrote until now :
...ANSWER
Answered 2021-Dec-30 at 07:13Can you replace graphql: true,
by graphiql: true, ?
as per here
Also in general try to have the port as 4000
QUESTION
I'm newbie with JEST. And I'm trying to make a fetch, but to do this I have to import it. But, I've got this error:
...ANSWER
Answered 2021-Nov-16 at 16:59There was a new major release of node-fetch with breaking changes. If you downgrade node-fetch to a previous version, for example node-fetch@2.6.6
, your code should work.
for more information: https://github.com/node-fetch/node-fetch/blob/HEAD/docs/v3-UPGRADE-GUIDE.md
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install express-graphql
Use .get or .post (or both) rather than .use to configure your route handler. If you want to show GraphiQL in the browser, set graphiql: true on your .get handler.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page