apollo-server

Deploying react/apollo-server app onto Heroku

假装没事ソ 提交于 2021-01-07 03:33:08
问题 What I'm trying to do is deploy react / apollo-server full stack app to heroku. Thus I' trying to serve static client files from express/apollo-server backend, like this: const path = require('path'); const express = require('express'); const app = express(); const cors = require('cors'); const { ApolloServer } = require('apollo-server'); const { schema } = require('./schema'); const { resolvers } = require('./resolvers'); app.use(cors()); app.use(express.static('public')); app.get('*', (req,

Deploying react/apollo-server app onto Heroku

☆樱花仙子☆ 提交于 2021-01-07 03:32:04
问题 What I'm trying to do is deploy react / apollo-server full stack app to heroku. Thus I' trying to serve static client files from express/apollo-server backend, like this: const path = require('path'); const express = require('express'); const app = express(); const cors = require('cors'); const { ApolloServer } = require('apollo-server'); const { schema } = require('./schema'); const { resolvers } = require('./resolvers'); app.use(cors()); app.use(express.static('public')); app.get('*', (req,

Does Apollo Server work with GraphQL Tools stitchSchemas?

ε祈祈猫儿з 提交于 2021-01-07 01:36:54
问题 According to Apollo docs "Apollo Server 2 exports all of graphql-tools, so makeExecutableSchema and other functions can be imported directly from Apollo Server." "Apollo Server is able to accept a schema that has been enabled by graphql-tools" However, I've just noticed I can't directly import stitchSchemas from apollo-server (I've been using it from @graphql-tools/stitch), and am hours deep in problems that aren't making sense. Does Apollo work with stitchSchemas or not? 回答1: Yes, you can

Does Apollo Server work with GraphQL Tools stitchSchemas?

冷暖自知 提交于 2021-01-07 01:33:16
问题 According to Apollo docs "Apollo Server 2 exports all of graphql-tools, so makeExecutableSchema and other functions can be imported directly from Apollo Server." "Apollo Server is able to accept a schema that has been enabled by graphql-tools" However, I've just noticed I can't directly import stitchSchemas from apollo-server (I've been using it from @graphql-tools/stitch), and am hours deep in problems that aren't making sense. Does Apollo work with stitchSchemas or not? 回答1: Yes, you can

How to execute a directive before a mutation is committed to the database?

懵懂的女人 提交于 2021-01-05 07:43:25
问题 I'm trying to add the internationalization feature to my database. It would be quite difficult to maintain a schema graphql if I needed to duplicate all translatable fields type Quest { name @i18n # simple } type Quest { nameEn nameJa nameFr ... # omg } The problem I'm facing is that field directives are only executed during a query (or, once a mutation has finished, to return the result). I do not see how I could do something similar with resolvers. For any possible mutation, I want to check

Request to API fails, reason: unable to verify the first certificate (and UNABLE_TO_VERIFY_LEAF_SIGNATURE)

自作多情 提交于 2021-01-05 06:42:10
问题 We have an Apollo Server which is calling an external API (which translates the REST API into GraphQL). Up until several days ago this worked fine, using cross-fetch to call the API. On Friday we started getting the following error (below). I've done some searching and it seems to have to do with certificates (see Error: unable to verify the first certificate in nodejs for example). Following the answer to that question, I tried using https://www.npmjs.com/package/ssl-root-cas and putting

Request to API fails, reason: unable to verify the first certificate (and UNABLE_TO_VERIFY_LEAF_SIGNATURE)

ⅰ亾dé卋堺 提交于 2021-01-05 06:41:56
问题 We have an Apollo Server which is calling an external API (which translates the REST API into GraphQL). Up until several days ago this worked fine, using cross-fetch to call the API. On Friday we started getting the following error (below). I've done some searching and it seems to have to do with certificates (see Error: unable to verify the first certificate in nodejs for example). Following the answer to that question, I tried using https://www.npmjs.com/package/ssl-root-cas and putting

Request to API fails, reason: unable to verify the first certificate (and UNABLE_TO_VERIFY_LEAF_SIGNATURE)

我怕爱的太早我们不能终老 提交于 2021-01-05 06:39:24
问题 We have an Apollo Server which is calling an external API (which translates the REST API into GraphQL). Up until several days ago this worked fine, using cross-fetch to call the API. On Friday we started getting the following error (below). I've done some searching and it seems to have to do with certificates (see Error: unable to verify the first certificate in nodejs for example). Following the answer to that question, I tried using https://www.npmjs.com/package/ssl-root-cas and putting

Request to API fails, reason: unable to verify the first certificate (and UNABLE_TO_VERIFY_LEAF_SIGNATURE)

给你一囗甜甜゛ 提交于 2021-01-05 06:39:07
问题 We have an Apollo Server which is calling an external API (which translates the REST API into GraphQL). Up until several days ago this worked fine, using cross-fetch to call the API. On Friday we started getting the following error (below). I've done some searching and it seems to have to do with certificates (see Error: unable to verify the first certificate in nodejs for example). Following the answer to that question, I tried using https://www.npmjs.com/package/ssl-root-cas and putting

Prisma 2 query to return records only that are associated with ALL of the provided tag IDs

和自甴很熟 提交于 2021-01-04 03:25:17
问题 I have tables Principles and Tags. And there is a many-to-many relation between them (joined implicitly). Without using prisma.raw , how can I run the following query? SELECT p.id, p.title, p.description, p.createdAt, p.modifiedAt FROM principle p WHERE EXISTS (SELECT NULL FROM _PrincipleToTag pt WHERE pt.B IN (${tagIds.join(',')}) AND pt.A = p.id GROUP BY pt.A HAVING COUNT(DISTINCT pt.B) = ${tagIds.length}) How can I update this Prisma 2 query such that the principles returned are only