Tag: Node.Js
-
How to define type for object in graphql schema?
-2 I have todo’s mongo schema like this: const todoSchema = new Schema( { userId: { type: String, required: true }, title: { type: String, required: true }, due_date: { date: { type: Number }, month: { type: Number }, year: { type: Number }, hours: { type: Number }, minute: { type: Number },…
-
How to import gql to create typedefs in apollo server v4?
0 In the version 3 of apollo server, we could use import {gql} from "apollo-server-express" to create typedefs and schemas. But in v4 of apollo server, apollo-server-express and apollo-server-core are depreciated and will be removed. So, instead of importing gql from apollo-server-express, how can we import gql I tried import gql from new @apollo/server and…
-
Data is not displayed at front end react with graphql queries at node.js backend
0 import { gql } from ‘@apollo/client’; const GET_CLIENTS = gql` query getClients { clients { id name email phone } } `; export { GET_CLIENTS }; import {gql} from ‘@apollo/client’; const DELETE_CLIENT = gql` mutation deleteClient($id: ID!) { deleteClient(id:$id) { id name email phone } } `; export {DELETE_CLIENT}; import React from ‘react’; import…
-
How to load a .graphql file using `apollo-server`?
35 I am currently loading the GraphQL schema using a separate .graphql file, but it is encapsulated within strings: schema.graphql const schema = ` type CourseType { _id: String! name: String! } type Query { courseType(_id: String): CourseType courseTypes: [CourseType]! } ` module.exports = schema Then using it for the apollo-server: index.js const { ApolloServer,…
-
How Can I Pass the Auth Middleware to the Apollo GraphQL Server
1 My App.js const mongoose = require(‘mongoose’); const dotenv = require(‘dotenv’); const { ApolloServer } = require(‘apollo-server’); const { startStandaloneServer } = require(‘@apollo/server/standalone’); const typeDefs = require(‘./apolloGraphql/schema’); const resolvers = require(‘./apolloGraphql/resolvers’); const auth = require(‘./Middleware/Auth’); dotenv.config({ path: ‘./config/.env’ }); const server = new ApolloServer({ typeDefs, resolvers, }); mongoose .connect(process.env.MONGOURI) .then((result) => { return server.listen(process.env.PORT, (req,…
-
GraphQL Dataloader on non-id fields?
0 We’re using NodeJS (typescript) and GraphQL for our backend. Therefore we rely heavily on dataloaders, and we get more and more field resolvers that needs to be resolved on something other than IDs. An example is a field resolver on our User object, called "follows_me". In this case we need to make a lookup…
-
Senior Consultant (GraphQL-Kafka-subscriptions) – VDart, Inc. – Plano, TX
VDart, Inc. Plano, TX Full Time, Accepts corp to corp applications, Contract: W2, Independent Skills AWS Node JS GraphQL Kafka subscriptions Job Description VDart Inc is the leading global provider of digital solutions, products and talent management company providing digital technology solutions in Automotive, Manufacturing, Energy & Utilities and Healthcare Industries. Led by a strong…
-
Lead GraphQL Developer – ADDSOURCE – Remote
ADDSOURCE Remote Skills API Best Practices Javascript User Interface Business Requirements ReactJS Node.js Translate graphql B2B Software Job Description Role Lead GraphQL Developer Location USA(Remote) Contract: 6+ Months **Responsibilities:** 1. Design, implement, and maintain GraphQL APIs for telecommunication customer-facing solutions. 2. Collaborate with cross-functional teams to understand business requirements and translate them into GraphQL schemas…
-
ApolloClient is not a constructor (apollo-client with nodejs)
9 I don’t have any UI framework. Just a simple Nodejs script where I need to query a GraphQL. Codes: const ApolloClient = require(‘apollo-client’) const client = new ApolloClient() Error message: TypeError: ApolloClient is not a constructor Package.json: { … “dependencies”: { “apollo-client”: “^2.4.13”, “graphql”: “^14.1.1”, “graphql-tag”: “^2.10.1” }, } Node: v8.9.4 I googled a…
-
Promise.all is only executing 1 out of 3 promises I pass to it
0 I have an async function, in which I take some arguments. Based on what is passed as argument, I call another function. You can consider the structure to be something like this. async function createTaskReminder(val) { switch (val) { case 1: await call1(); case 2: await call2(); case 3: await call3(); } I call…