apollo

Apollo graphql setting header to authmiddleware not working

孤街醉人 提交于 2021-01-07 03:28:04
问题 I am using react-native and apollo client and if I try to set header by jwt stored in AsyncStorage, it seems not working. Other resolvers which doesn't need header works very well. My code is like below. import { ApolloClient } from "apollo-client"; import { InMemoryCache } from "apollo-cache-inmemory"; import { ApolloLink } from "apollo-link"; import { createHttpLink } from "apollo-link-http"; import AsyncStorage from "@react-native-community/async-storage"; const cache = new InMemoryCache()

Apollo graphql setting header to authmiddleware not working

纵然是瞬间 提交于 2021-01-07 03:27:07
问题 I am using react-native and apollo client and if I try to set header by jwt stored in AsyncStorage, it seems not working. Other resolvers which doesn't need header works very well. My code is like below. import { ApolloClient } from "apollo-client"; import { InMemoryCache } from "apollo-cache-inmemory"; import { ApolloLink } from "apollo-link"; import { createHttpLink } from "apollo-link-http"; import AsyncStorage from "@react-native-community/async-storage"; const cache = new InMemoryCache()

Apollo graphql setting header to authmiddleware not working

两盒软妹~` 提交于 2021-01-07 03:27:00
问题 I am using react-native and apollo client and if I try to set header by jwt stored in AsyncStorage, it seems not working. Other resolvers which doesn't need header works very well. My code is like below. import { ApolloClient } from "apollo-client"; import { InMemoryCache } from "apollo-cache-inmemory"; import { ApolloLink } from "apollo-link"; import { createHttpLink } from "apollo-link-http"; import AsyncStorage from "@react-native-community/async-storage"; const cache = new InMemoryCache()

自动驾驶2020:跨越险阻,珠峰沿途好风景

最后都变了- 提交于 2021-01-06 02:32:56
文 |魏启扬 来源|智能相对论(aixdlun) 2020年的疫情是一块试金石,也是一针催化剂。 自动驾驶的泡沫本已被戳破过多次,然而,2020年残酷的市场环境之下,行业再次经受历练,有离开的,有彷徨的,当然,也有风光无两,高歌猛进的。 从Robotaxi全面开放测试,到安全员被请出驾驶室;从4.6亿智能交通超级项目落地,到智能汽车大批量产…… 自动驾驶在2020年取得的商业成绩超过以往任何一年,我们可以将其视为技术精进之后的必然爆发;也可以视为跨越最初的险阻,完成从0到1的积累之后,开始有闲暇心情欣赏攀登珠峰沿途的风光。 有初创企业持续融资,也有明星公司陨落 2019年,我们为Drive.ai、RoadStar这样的明星公司陨落而唏嘘不已,也为Argo AI、Cruise等公司拿到巨额融资而兴奋。 自动驾驶行业的冷暖两面在2020年依然延续。 先是3月份,首家公开测试自动驾驶卡车的明星公司Starsky Robotics毫无征兆的直接破产,接着6月份时,累计融资超过70亿元的自动驾驶公司Zoox因“资金链断裂”而卖身亚马逊,但其收购标价还不及上一轮融资估值的一半。 与此同时,Cruise、Kodiak、Ike、Starship等自动驾驶公司也先后曝出裁员消息。 是疫情的原因压垮了这些企业吗?相反,无人驾驶“无接触服务”的特点让其在抗疫前线成为现象级的存在,特别是低速无人车迎来爆发

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

How can I make this a callable utils function that contains a hook?

岁酱吖の 提交于 2021-01-04 06:36:09
问题 I'm currently using Apollo Client's useQuery and useMutation hooks to perform the same function in several different components. Instead of repeating the logic, I would like to create a helper function that can keep the logic in a single place. The problem with this, is useQuery and useMutation being hooks mean they can't just live in a separate file as functions, but instead need to be valid React function components. I started trying to make something functional but starting to think this

react-apollo gql, TypeError: Object(…) is not a function

淺唱寂寞╮ 提交于 2021-01-02 05:51:41
问题 I have a App component that I am wrapping into a apollo provider: import React, { Component } from "react"; import { observer, Provider } from "mobx-react"; import { BrowserRouter as Router } from "react-router-dom"; import styled from "styled-components"; import { ThemeProvider } from "styled-components"; // graphQL import { ApolloClient } from "apollo-client"; import { createHttpLink } from "apollo-link-http"; import { setContext } from "apollo-link-context"; import { InMemoryCache } from