Relay

MySQL主从数据库配置和常见问题

那年仲夏 提交于 2020-01-06 17:01:28
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 公司运维能力不是太好,数据库最近出了一次问题,导致丢失了一天的数据,并且某个服务宕机一晚上。为了避免再次出现类似问题,我决定添加一个Slave服务器,以避免数据丢失和服务宕机的问题。 MySQL 本身就提供了主从备份方式,下面介绍配置方法。 1. 环境说明 两台服务器,系统均为CentOS7系统,MySQL版本均为5.7及以上,保证从库版本与主库版本相同,或者高于主库版本。 2. 配置方法 2.1 主库配置 主库主要是修改一下MySQL的配置文件,让主库记录binlog,并且提供一个从库用来连接主库的用户。下面是具体的配置及解释。 vim / path /to/my . cnf # 在my . cnf中的 [ mysqld ] 下面,添加以下配置。 server - id = 1 ## 以下是可选配置 # binlog文件前缀 lob - bin = mysql - bin # 忽略以下数据库 binlog - ignore - db = information_schema , mysql # 备份以下数据库 binlog - do - db = test # 添加后,执行以下语句,重启MySQL服务。 systectl restart mysqld 之后

Cannot read property 'after' of undefined in implementing react-relay

落爺英雄遲暮 提交于 2020-01-05 04:16:06
问题 In my nodejs application here is my schema.js file import { GraphQLBoolean, GraphQLID, GraphQLInt, GraphQLList, GraphQLNonNull, GraphQLObjectType, GraphQLSchema, GraphQLString, } from 'graphql'; import { connectionArgs, connectionDefinitions, connectionFromArray, connectionFromPromisedArray, cursorForObjectInConnection, fromGlobalId, globalIdField, mutationWithClientMutationId, nodeDefinitions, toGlobalId, } from 'graphql-relay'; import { User, getUser, getPosts, createpost, } from '../data

Implement multiple interfaces in graphql

冷暖自知 提交于 2020-01-03 19:16:20
问题 I am using the relay compiler and it is not letting me compile a schema with a type that implements multiple interfaces. I made a small test project: package.json { "scripts": { "relay": "relay-compiler --src ./ --schema schema.graphqls" }, "dependencies": { "react-relay": "1.5.0" }, "devDependencies": { "relay-compiler": "1.5.0" } } schema.graphqls interface First { a: String } interface Second { b: String } type Something implements First, Second { a: String b: String } test.js import {

Relay/GraphQL add custom field to connection

点点圈 提交于 2020-01-03 06:42:11
问题 I am trying to add the totalcount of records to be used for pagination. Right now i can see the connection i am having trouble modifying it to get my totalCount to be apart of it. Books: { type: BooksConnection.connectionType, args: { ...connectionArgs, isbn: { type: GraphQLString }, publisher: {type: GraphQLString}}, resolve: ( obj, { ...args }, context, { rootValue: objectManager } ) => { let user = obj; let FormatedArgs = MasterFields.FormatPredicate(args); return objectManager.getListBy(

Fragment “F1” cannot be spread here as objects of type “Node” can never be of type “Store”

家住魔仙堡 提交于 2019-12-25 18:36:37
问题 I have written below code : On Certain User Action below method is called : handleFolderClicked = (topic, parent) => { console.log('Main : handleFolderClicked called : ', parent); this.props.relay.setVariables({ parentFolder: parent, email: loginEmail }); } Main = Relay.createContainer(Main, { initialVariables: { pageSize: pageSize, email: loginEmail, parentFolder: parentFolder, }, fragments: { store: () => Relay.QL` fragment on Store { id, fileConnection(first:999, email:$email, parentFolder

Fragment “F1” cannot be spread here as objects of type “Node” can never be of type “Store”

梦想的初衷 提交于 2019-12-25 18:36:18
问题 I have written below code : On Certain User Action below method is called : handleFolderClicked = (topic, parent) => { console.log('Main : handleFolderClicked called : ', parent); this.props.relay.setVariables({ parentFolder: parent, email: loginEmail }); } Main = Relay.createContainer(Main, { initialVariables: { pageSize: pageSize, email: loginEmail, parentFolder: parentFolder, }, fragments: { store: () => Relay.QL` fragment on Store { id, fileConnection(first:999, email:$email, parentFolder

Refetch method for createRefetchContainer doesn't execute callback

六眼飞鱼酱① 提交于 2019-12-24 18:51:29
问题 My QueryRenderer uses the following Query: ``` graphql` query page_Query { viewer { id ...MountedRenderer_viewer } } ` and this is what my createRefetchContainer looks like: ``` createRefetchContainer( MountComponent, graphql` fragment MountedRenderer_viewer on User @argumentDefinitions(show: { type: "Boolean", defaultValue: false }) { id name @include(if: $show) } `, graphql` query OwnershipsRenderer_Query($show: Boolean!) { viewer { ...MountedRenderer_viewer @arguments(show: $show) } } `, )

relay refetch doesn't show the result

不想你离开。 提交于 2019-12-22 10:40:37
问题 I'm trying to create a live search-result component(lazy load one). It works perfectly for the first time but refetch doesn't update the data. I see the request and respoonse in Network tab! so it does get the data, but it doesn't supply it to the component! any idea why? import React, { Component } from 'react'; import { createRefetchContainer, graphql, } from 'react-relay'; import ProfileShow from './ProfileShow'; class ProfileList extends Component { render() { console.log("rendering....",

Nested fragment data always the same in Relay

♀尐吖头ヾ 提交于 2019-12-22 10:28:01
问题 I'm new to Relay and am having an issue with nested data on a fragment. The following query returns the correct data when I test in it graphiql so I am confident my schema is correct. { viewer { customers { name billing_address { city } } } } However, when I use the above query with Relay the customer.name will be correct but customer.billing_address.city is the same for every customer. It's confusing to me why some of the data would be correct while the nested data would just be copied. I

Broken autobinding in arrow function for referenced node modules when using react-native with react-relay

本小妞迷上赌 提交于 2019-12-22 09:36:17
问题 I'm using react-native and react-relay, therefore I've the following .babelrc file: { "sourceMaps": "both", "presets": [ "./plugins/babelRelayPlugin", "react-native" ], "passPerPreset": true } Adding a dependency which uses arrow functions in their components as the MKIconToggle from react-native-material-kit (https://github.com/xinthink/react-native-material-kit) doesn't get transpiled correctly and the this reference is lost/wrong. The original code which ultimately causes the error looks