graphql

Fetching remote images and converting them to gatsby images

≡放荡痞女 提交于 2021-02-11 14:14:06
问题 I'm trying to fetch some images from WP because Gatsby doesn't work with woocommerece yet. My plugin below is able to convert the images and add them to .cache when building, but it doesn't add a field of localFile___NODE within the Gatsby graphQl. It doesn't seem to be adding any nodes at all for me to query with ImageSharp plugin. Graphql shows them being processed under ALLFiles but not within the wcProduct node I've created in Graphql...what is going on that this plugin is not creating

Facebook 前端技术栈重构分享

无人久伴 提交于 2021-02-11 13:41:42
阿里@张克军翻译 当我们考虑如何构建一个新的网络应用—一个为现代浏览器设计的、具有用户对Facebook(我们已知的)所有期望的功能,我们现有的技术栈无法支持我们所需要的类似于桌面应用的感觉和性能。完全重写是非常罕见的,但在这种情况下,由于过去十年来Web技术发生了很多变化,我们知道这是我们实现性能和未来可持续发展目标的唯一途径。今天,我们就分享一下我们在重构Facebook.com时的经验教训,使用React(一种用于构建用户界面的声明式JavaScript库)和Relay(React的GraphQL客户端)来重构Facebook.com。 1. 开始 我们希望Facebook.com能够快速启动,快速响应,并提供高度互动的体验。虽然服务端驱动(server-driven)的应用程序可以提供快速启动时间,但我们不相信它能像客户端驱动(client-driven)的应用程序那样具有互动性和愉悦性。然而,我们相信我们可以构建一个客户端驱动的应用程序,并能提供具有竞争力的快速启动时间。 但是从头开始做一个客户端优先的APP,这带来了一系列新的问题。我们需要快速重建网站,同时解决速度和其他用户体验问题,而且在未来几年内能可持续的发展。在整个过程中,我们围绕着两个技术口号开展工作: 尽可能少,尽可能早。只提供所需要的资源,而且能在需要的时候及时送达。 服务于用户体验的工程体验

How to handle apollo client errors crashing page render in Nuxt?

∥☆過路亽.° 提交于 2021-02-11 12:47:33
问题 I'm currently maintaining a production Nuxt.js Vue app that integrates GraphQL Apollo Client that's running into page render errors. For the sake of boosting my chances of getting a response, I built a bare-bones code example that showcases only the problem we are running into. Thanks everybody. Source Code Client, https://github.com/sgarcia-dev/error-apollo-client-nuxt Server, https://github.com/sgarcia-dev/error-apollo-server The Problem The problem, is that every now and then, the GraphQL

Missing movies attribute on result Vue GraphQL

倖福魔咒の 提交于 2021-02-11 12:37:47
问题 I am frontend developer so for the first time I got my hands on vue and graphql, I don’t know how exactly to deal with this error: Missing getMovies attribute on result {movies: Array(20)} Here is my code, and I can see the data is fetched successfully in the response on dev tools in chrome: {"data":{"movies":[{"__typename":"Movie","id":11,"overview": Here is the code: <template> <div class="hello"> <ul> <li v-for="movie in movies" :key="movie.id">{{movie.title}}</li> </ul> </div> </template>

Missing movies attribute on result Vue GraphQL

泄露秘密 提交于 2021-02-11 12:37:00
问题 I am frontend developer so for the first time I got my hands on vue and graphql, I don’t know how exactly to deal with this error: Missing getMovies attribute on result {movies: Array(20)} Here is my code, and I can see the data is fetched successfully in the response on dev tools in chrome: {"data":{"movies":[{"__typename":"Movie","id":11,"overview": Here is the code: <template> <div class="hello"> <ul> <li v-for="movie in movies" :key="movie.id">{{movie.title}}</li> </ul> </div> </template>

How to use standard search analyzer with keyword mapping?

若如初见. 提交于 2021-02-11 12:30:03
问题 I have to use search_analyzer not with text but with type keyword as below: "properties":{ "email" : { "type" : "keyword", "analzer":"autocomplete", "search_analyzer":"standard" } } But actually I have below mappping: "properties":{ "email" : { "type" : "keyword", } } 回答1: Analyzers only work with type text , not keyword . So you cannot define a search_analyzer on a keyword field. However, what you can do is to create a sub-field of type text like this: PUT your-index/_mapping { "properties":

Can I create multiple elements of the same type using Strapi and GraphQL?

南笙酒味 提交于 2021-02-11 12:23:08
问题 Can I create multiple elements of the same type using Strapi and GraphQL? For example - createMultipleFoo mutation(data: [ nameOfFoo: "ooaoaoa", weightOfFoo: "aododo" ], ....) 回答1: It's in the roadmap. What you can do for now is create a custom endpoint ie. "createMulti". Send a json array, and use the "regular" create for each. Check out the discussion here. Any questions post a comment 来源: https://stackoverflow.com/questions/63260467/can-i-create-multiple-elements-of-the-same-type-using

SyntaxError: Unexpected token { when compiling my node.js code

谁都会走 提交于 2021-02-10 16:59:14
问题 I'm getting the below error every time with the first 'import' when I trying to run grandstack neo4j graphql api app. PS C:\Users\grand-stack-starter-master\api> nodemon index.js [nodemon] 1.19.1 [nodemon] to restart at any time, enter `rs` [nodemon] watching: *.* [nodemon] starting `node index.js src/index.js` C:\Users\grand-stack-starter-master\api\src\index.js:1 import { typeDefs } from "./graphql-schema"; ^ SyntaxError: Unexpected token { at Module._compile (internal/modules/cjs/loader.js

SyntaxError: Unexpected token { when compiling my node.js code

眉间皱痕 提交于 2021-02-10 16:59:05
问题 I'm getting the below error every time with the first 'import' when I trying to run grandstack neo4j graphql api app. PS C:\Users\grand-stack-starter-master\api> nodemon index.js [nodemon] 1.19.1 [nodemon] to restart at any time, enter `rs` [nodemon] watching: *.* [nodemon] starting `node index.js src/index.js` C:\Users\grand-stack-starter-master\api\src\index.js:1 import { typeDefs } from "./graphql-schema"; ^ SyntaxError: Unexpected token { at Module._compile (internal/modules/cjs/loader.js

Apollo Server Express: Request entity too large

风格不统一 提交于 2021-02-10 14:25:48
问题 I need to POST a large payload in a GraphQL mutation. How do I increase the body size limit of Apollo Server? I'm using apollo-server-express version 2.9.3. My code (simplified): const myGraphQLSchema = new GraphQLSchema({ query: new GraphQLObjectType({ name: 'Query', fields: { user: UserQuery, }, }), mutation: new GraphQLObjectType({ name: 'Mutation', fields: () => ({ ...UserMutations, }), }), }); const apolloServer = new ApolloServer(schema: myGraphQLSchema); const app = express(); app.use