graphql, union scalar type?

Scalars can’t be used as part of unions, since per the specification, unions specifically “represent an object that could be one of a list of GraphQL Object types.” Instead, you can use a custom scalar. For example: const MAX_INT = 2147483647 const MIN_INT = -2147483648 const coerceIntString = (value) => { if (Array.isArray(value)) { throw … Read more

How to get requested fields inside GraphQL resolver?

In graphql-js resolvers expose a fourth argument called resolve info. This field contains more information about the field. From the GraphQL docs GraphQLObjectType config parameter type definition: // See below about resolver functions. type GraphQLFieldResolveFn = ( source?: any, args?: {[argName: string]: any}, context?: any, info?: GraphQLResolveInfo ) => any type GraphQLResolveInfo = { fieldName: … Read more

What is AST in graphql?

GraphQL is two things: A query language A Type System When a GraphQL server receives a query to process it generally comes in as a single String. This string must be split into meaningful sub-strings (tokenization) and parsed into a representation that the machine understands. This representation is called an abstract syntax tree, or AST. … Read more

expressGraphQL is not a function

Please replace your expressGraphQL with graphqlHTTP as it was destructured Use: const { graphqlHTTP } = require(‘express-graphql’); or const expressGraphQL = require(‘express-graphql’).graphqlHTTP This is because a method called graphqlHTTP exist in the express-graphql module and you are destructure with another method name that does not exist in the module I also noticed that you have … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)