Skip to content
Advertisement

Tag: node.js

How i take a value that is like field in my database?

I try to get values that contains words in my sql database. I try with “contains” but I get an error. I work with SQL This is my code: I have this error: UnhandledPromiseRejectionWarning: Error: ER_PARSE_ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use

Graphql, node.js and sql,Cannot return null for non-nullable field

I want to return data coming from db to the api. The data is being logged but not showing on the graphql api. RESULT: OUTPUT: Answer This is your resolver: A GraphQL resolver must return either a value or a Promise that will resolve to a value. However, here, you’re not returning either. Keep in mind that callbacks are invoked

Is escaping SQL queries like this safe?

I am currently working on a NodeJS backend script that parses incoming HTTP requests to write to and read from a MySQL database for work. I tried to protect it against SQL injections by using a kind of two-layer protection. To write to the database the user needs to provide valid JSON. This is how the JSON’s keys need to

Advertisement