小编use*_*979的帖子

如何使用GraphQL将二进制数据发送回客户端

我有一个GraphQL服务器,托管在express上.我想通过发回nodejs缓冲区对象将图像返回给客户端.如何配置graphql server,返回字节,而不是json?我不希望通过base64这样做,因为图像很大.

javascript node.js graphql

16
推荐指数
1
解决办法
5605
查看次数

反应原生的CSS动画和转换

只是想知道我们是否可以在react-native中使用CSS动画和转换?即

 <Image style={animateImage} / >

StyleSheet.create({

 animateImage {
   width: 100px;
   height: 100px;
   background: red;
   transition: width 3s;
   transition-delay: 1s;
 }

});
Run Code Online (Sandbox Code Playgroud)

css react-native

8
推荐指数
1
解决办法
8001
查看次数

模拟 graphql 服务器

我正在尝试模拟我的 graphql 服务器,以便当我查询时,它返回模拟数据而不是转到 graphql 服务器。当我对模拟 graphql 运行查询时,我收到了这个错误:

"errors":[{"message":"Syntax Error GraphQL request (1:13) Expected $, found Name \"input\"\n\n1: query login(input: {userName: \"james\" , passWord: \"password\"}

这是我目前的设置:

询问

let query = `query login(input: {userName: "james" , passWord: "password"}){
   login(input: {userName: "james" , passWord: "password"})
}`;
Run Code Online (Sandbox Code Playgroud)

架构

const typeDefs = `
type loginCrendentialsType {
  data: String
}
input loginInputType{
  userName: String!
  passWord: String!
}
type RootQuery {
  login(input: loginInputType): [loginCrendentialsType]
}
schema {
  query: RootQuery
}
`;
Run Code Online (Sandbox Code Playgroud)

嘲笑

const mocks = {
 login: …
Run Code Online (Sandbox Code Playgroud)

graphql

5
推荐指数
1
解决办法
1995
查看次数

我的无状态组件未呈现(Reactjs 和 Redux)

出于某种原因,我的 allEmployees 无状态组件没有被呈现,我不知道为什么。我收到以下警告:

标签employeesData上的未知道具<allEmployees>。从元素中移除这个道具。

容器

class employeeListPage extends React.Component {
 constructor(props) {
 super(props);
 this.state = {
    employees : {}
 };
}

render(){
  return(
    <div>
        <allEmployees employeesData = {this.props.employees} />
    </div>
  )
}

}
function mapStateToProps(state, ownProps){
 return{
    employees: state.employees
}
}

function mapDispatchToProps(dispatch){
 return {
    employeeActions : bindActionCreators(employeeActions, dispatch)
 };
}

export default connect(mapStateToProps, mapDispatchToProps )(employeeListPage);
Run Code Online (Sandbox Code Playgroud)

allEmployees 组件

 const allEmployees = (props) => (
    <div>
     <table>
      <thead>
        <tr>
             <th>Employee Number</th>
             <th>Employee Full Name</th>
             <th>Active Employee</th>
             <th>Origin</th> …
Run Code Online (Sandbox Code Playgroud)

reactjs redux

3
推荐指数
1
解决办法
2058
查看次数

标签 统计

graphql ×2

css ×1

javascript ×1

node.js ×1

react-native ×1

reactjs ×1

redux ×1