我正在尝试使用 graphql 后端(elixir/phoenix)设置 React/Apollo 前端。我做了npm install apollo-boost react-apollo graphql --save然后尝试import ApolloClient from "apollo-boost";在我的index.js中但我得到了
Uncaught Error: Cannot find module 'graphql' from 'apollo-link-state/lib/bundle.umd.js'
at require (app.js:61)
at expanded (app.js:34)
at app.js:148
at connectionRemoveConfig.test (bundle.umd.js:6)
at bundle.umd.js:9
at bundle.umd.js:151
at initModule (app.js:42)
at require (app.js:59)
at expanded (app.js:34)
at app.js:148
Run Code Online (Sandbox Code Playgroud)
在我的浏览器控制台中。我找不到任何相关问题。你能指出哪里出了问题吗?这是我的package.json。
{
"repository": {},
"license": "MIT",
"scripts": {
"deploy": "brunch build --production",
"watch": "brunch watch --stdin"
},
"dependencies": {
"apollo-boost": "^0.1.16",
"babel-preset-react": "^6.24.1",
"graphql": "^14.0.2",
"phoenix": "file:../deps/phoenix", …Run Code Online (Sandbox Code Playgroud) 我通过从ghci检查它来声明类型声明但是加载模块会给出错误:
even-fibbanaci-sum.hs:7:12: error:
Couldn't match expected type ‘a’ with actual type ‘Double’
‘a’ is a rigid type variable bound by
the type signature for:
getFib :: forall b a. (Integral b, Floating a) => b -> a
at even-fibbanaci-sum.hs:4:12
In the expression: ((phi ^ n) - (minusphi ^ n)) / sqrt 5
In an equation for ‘getFib’:
getFib n = ((phi ^ n) - (minusphi ^ n)) / sqrt 5 • Relevant bindings include
getFib :: b -> a (bound …Run Code Online (Sandbox Code Playgroud)