apollo

How to fix iOS 12 Safari Cors preflight error?

六眼飞鱼酱① 提交于 2019-12-19 03:45:40
问题 I am trying to understand CORs a little better as several users of our web app are complaining since they upgraded to iOS 12 they are receiving preflight errors. The errors from the web inspector [Error] Preflight response is not successful [Error] Fetch API cannot load https://www.api.com due to access control checks. [Error] Failed to load resource: Preflight response is not successful (v4, line 0) The client app is a React app with Apollo. It calls a server over HTTPS with Apache HTTPD and

How to use client.query without JSX components in Apollo Client?

三世轮回 提交于 2019-12-18 08:54:08
问题 I'm trying to make a query in Apollo Client with React without returning a JSX component, just an object (the data object that is received when making a common query to Apollo Server). I tried using <Query /> component, but it returns me a React Node and I only need an object. The documentation only explain methods that return JSX components at some point, when all that I'm looking to do is send a request and process the response in a callback. Actually I'm trying this way (I'm using

apollo环境搭建

安稳与你 提交于 2019-12-18 03:03:12
Apollo简介 Apollo(阿波罗)是携程框架部门研发的分布式配置中心,能够集中化管理应用不同环境、不同集群的配置,配置修改后能够实时推送到应用端,并且具备规范的权限、流程治理等特性,适用于微服务配置管理场景。(官方回答) 在微服务架构下,我们可能要管理几十个、成百上千个服务,在这样的情况下不得不考虑配置文件的处理。一个可以方便快捷的处理这些配置文件的配置中心是开发人员刚需的,顺应潮流SpringCloudConfig和apollo就出现了。 为什么用Apollo而不用springCloudConfig? 虽然springCloudConfig对SpringCloud支持更好但是需要结合git,没有可视化界面,并且从功能上来看apollo更加全面、强大,而且apollo开源,社区活跃, 开源地址 实例 从官网下载所需文件 下载这三个 也可以去我的网盘下载 地址 提取码:b3bh 准备工作 jdk要求如下: Apollo服务端:1.8+ Apollo客户端:1.7+ 建议1.8及以上 mysql 5.6.5+ window搭建 step1 ,将下载好的zip分别解压至新建的三个folder step2 ,修改apollo-configserviceDBconfig spring . datasource . url = jdbc : mysql : / / 127.0 .0 .1

安装ctrip-apollo多环境部署总结

六眼飞鱼酱① 提交于 2019-12-15 13:36:34
1、下载( https://github.com/ctripcorp/apollo/releases)apollo三个压缩文件 2、在本机安装mysql5.7 安装步骤略。 3、创建数据库 开发环境(dev):apolloconfigdb 测试呼叫(fat):apolloconfigdb2 portal:apolloportaldb 注意:一个portal管理多个环境,只需要部署一个portal程序,一个portal库。config与admin,每个环境需要个配一套。 4、修改的配置文件 4.1 portal配置 cd /data/apollo-portal/config vim apollo-env.properties 保存 vim application-github.properties 保存 4.2 config配置 第一个config cd /data/apollo-configservice/config/ vim application-github.properties 第二个config cd /data/apollo-configservice/config/ vim application-github.properties 4.3 admin配置 第一个admin cd /data/apollo-adminservice/config vim

How to return both error and data in a graphql resolver?

自闭症网瘾萝莉.ら 提交于 2019-12-13 14:25:35
问题 I was thinking about ways of implementing graphql response that would contain both an error and data. Is it possible to do so without creating a type that would contain error ? e.g. Mutation addMembersToTeam(membersIds: [ID!]! teamId: ID!): [Member] adds members to some team. Suppose this mutation is called with the following membersIds : [1, 2, 3] . Members with ids 1 and 2 are already in the team, so an error must be thrown that these members cannot be added, but member with an id 3 should

How to load query from .graphql file with angular and typescript

蓝咒 提交于 2019-12-13 03:55:56
问题 I am working on an app with Angular and Ionic. As a backend I have a node server running ApolloServer with Neo4j (using grandstarter.io). On the client-side I currently have a file called queries.ts where I have defined my graphql queries like this: supplierByName = (value) => { const query = gql` { Supplier(filter: {name: "${value}"}) { name } } `; return query; }; I am using apollo so I am doing like this to run my graphql query this.apollo.query({ query: this.queries.supplierByName

React Nextjs won't compile when using react-apollo

℡╲_俬逩灬. 提交于 2019-12-13 03:10:40
问题 A very strange one here, so if anybody can shed light on it I will be impressed. Good When I use a <h1 /> inside a component and build the server with npm run dev everything will work as expected. I can replace the h1 with the <Query /> component from react-apollo the app reloads correctly and I receive data as I should. Bad However, if I restart the server either manually or with a /server file change. It will just hang indefinitely. return ( <Query query={query}> {({ loading, data, error,

Apollo readQuery Fails Even Though Target Object is Present?

﹥>﹥吖頭↗ 提交于 2019-12-12 10:11:28
问题 I'm working on a call to readQuery. I'm getting an error message: modules.js?hash=2d0033b4773d9cb6f118946043f7a3d4385825fe:25847 Error: Can't find field resolutions({"id":"Resolution:DHSzPa8bvPCDjuAac"}) on object (ROOT_QUERY) { "resolutions": [ { "type": "id", "id": "Resolution:AepgCCio9KWGkwyMC", "generated": false }, { "type": "id", "id": "Resolution:DHSzPa8bvPCDjuAac", // <==ID I'M SEEKING "generated": false } ], "user": { "type": "id", "id": "User:WWv57KsvqWeAoBNHY", "generated": false }

How to use this.state.rent value instead of this.props.house.rent value in cache.readQuery or cache.writeQuery

丶灬走出姿态 提交于 2019-12-11 19:13:27
问题 The old value comes back into the input field. I had initialized this.props.house.rent (which is the old value coming back) with input field value this.state.rent (user entered value) but I cannot do it as it becomes antipattern syntax, you can see it in below comments of code. cacheUpdate = (cache, { data: { updateHouse } }) => { const data = cache.readQuery({ query: QUERY_CONFIRM_QUERY, variables: { id: this.props.confirmId }, }); const houses = data.queryConfirm.houses; const prevHouse =

Nest a query inside mutation graphql

ぐ巨炮叔叔 提交于 2019-12-11 19:04:36
问题 As you need to include a query inside of your mutation to get the internal cache to update after a mutation I have now come across a situation where I have a query with a function that accepts variables . I cannot find a way to include this query inside the mutation. I thought I may need to pass all variables inside the mutation including those that are needed for the query, but this makes no sense. Works correctly, this will redraw once the mutation has finished export const GET_PICK_TICKETS