graphql

Advice on building graphQL queries in c#

天涯浪子 提交于 2021-01-28 23:33:12
问题 I am working on a data migration project - API to API. The destination API is graphQL, we have a number of objects to push into the destination and the shapes vary so I am looking for some advice on how best to dynamically build mutations/queries specifically in c#. Currently we are just using templates and using find/replace routines to inject values. While this approach does work as the shapes of the data vary this becomes evermore complex and inelegant. I am looking for any advice/pointers

Advice on building graphQL queries in c#

给你一囗甜甜゛ 提交于 2021-01-28 23:21:04
问题 I am working on a data migration project - API to API. The destination API is graphQL, we have a number of objects to push into the destination and the shapes vary so I am looking for some advice on how best to dynamically build mutations/queries specifically in c#. Currently we are just using templates and using find/replace routines to inject values. While this approach does work as the shapes of the data vary this becomes evermore complex and inelegant. I am looking for any advice/pointers

Query works in GraphiQL but returns empty array in Actual Code while using React Apollo

荒凉一梦 提交于 2021-01-28 21:51:07
问题 I have a simple query like this import gql from "graphql-tag"; export const GET_TODOS_BY_PRODUCT = gql` query getTodosByProduct( $id: ID! $completed: Boolean = false $limit: Int = 100 ) { product(id: $id) { hashtag todos(completed: $completed, limit: $limit) { body } } } `; In GraphiQL, it returns results like - { "data": { "product": { "todos": [ { "body": "Remove Custom Font from Tweet #a2k", "product": { "id": "1439" }, "__typename": "Todo" }, { "body": "Make Site a PWA #a2k", "product": {

Query works in GraphiQL but returns empty array in Actual Code while using React Apollo

跟風遠走 提交于 2021-01-28 21:24:56
问题 I have a simple query like this import gql from "graphql-tag"; export const GET_TODOS_BY_PRODUCT = gql` query getTodosByProduct( $id: ID! $completed: Boolean = false $limit: Int = 100 ) { product(id: $id) { hashtag todos(completed: $completed, limit: $limit) { body } } } `; In GraphiQL, it returns results like - { "data": { "product": { "todos": [ { "body": "Remove Custom Font from Tweet #a2k", "product": { "id": "1439" }, "__typename": "Todo" }, { "body": "Make Site a PWA #a2k", "product": {

Documentation at the top level of a GraphQL schema

℡╲_俬逩灬. 提交于 2021-01-28 19:20:57
问题 I'm documenting all my types, fields and parameters in my schema (SDL), including Query and Mutation at the top - but I can't work out how to add a single piece of documentation for the top-level of the whole schema. I'm not sure if it's the spec or the tooling - Apollo for example allows me to write schema { } , but not to put anything inside it, or documentation before it. And there are no examples of it in the docs, particularly at https://graphql.github.io/graphql-spec/June2018/#sec

Question about parent/child relationships and components

我是研究僧i 提交于 2021-01-28 14:10:26
问题 I'm currently trying to port a project from vuex/REST to vue-apollo. The project shows a list of events, and each event can be expanded to show details, including attendees. So I'm having an EventList component, that fetches the events and all attributes necessary for the list. And I have a EventDetails child component that is expanded from the list onclick. EventDetails requires some event data as well as the list of attendees to render. Problem is, I cannot find an elegant way to build the

How to upload images to fastify + graphql backend with axios?

做~自己de王妃 提交于 2021-01-28 13:35:50
问题 When sending images via axios I found I have to use formdata. I add my images here but when sending the formdata my entire backend just freezes, just says "pending". Ive been following this And my attempt so far: backend: Apollo: import { ApolloServer, makeExecutableSchema } from 'apollo-server-fastify'; const schema = makeExecutableSchema({ typeDefs, resolvers }); const apolloServer = new ApolloServer({ schema, uploads: { maxFileSize: 10000000, maxFiles: 5, }, }); (async function() { app

【大咖分享】BFF在千寻位置网前端的落地和演进

血红的双手。 提交于 2021-01-28 12:59:36
掌门教育前端技术分享会第一期已于1.23号落幕,以下为大咖讲师们现场演讲的整理稿,感谢大家的支持: 讲师介绍 唐兵,前端技术专家,来自千寻位置网业务中台前端团队 负责团队电商相关业务开发,团队BFF层技术负责人 团队日常工作内容,主要对公司门户、电商、营销、分销等业务提供前端支持,业务覆盖 PC、H5、App、小程序、NodeJS 等各种技术场景。 以下为唐兵同学的部分精彩演讲内容: BFF的历史演化进程 前端BFF层,我们大概经历了四个阶段: serverAPI:后端直接将接口暴露给前端开发,进行业务调用,也是我们前端开发最常接触到的模式。 internalRest:后端同学在底层service数据接口的基础上,进行业务页面逻辑聚合处理,再透传到前端进行页面数据渲染。 Apoll-Graphql:业务接口聚合结构化、模块化,目前这块是由我们千寻位置网前端开发同学牵头;这里的背景是,目前公司后端服务基本都是采用微服务化开发,接口数据都是原子化交付, Apoll-Federation:在Graphql基础上,做支撑服务的拆分,以提供更好的开发体验 目前,千寻位置网前端处于第三向第四阶段过渡 InternalRest 对应后端开发同学来说,强耦合页面展示逻辑的开发方式来开发API,开发体验很差、有干扰,internalRest可以帮助开发同学做开发分层

React apollo not update data after mutation

我只是一个虾纸丫 提交于 2021-01-28 08:08:16
问题 I have user and user update form, but the problem is that user data in a web app is not updated after mutation. mutation: mutation UserUpdate($user: UserUpdateInput!, $id: String!) { userUpdate(user: $user, id: $id) { id } } query: query UsersItemQuery($id: String!) { userById(id: $id) { id email datetime firstName lastName middleName phone role podcasts { id title } } } I use it on my UserItem.tsx component: const usersItem = useQuery<UsersItemQuery, UsersItemQueryVariables>(usersItemQuery,

GraphQL API works with Postman, but failed with Javascript fetch

a 夏天 提交于 2021-01-28 08:00:27
问题 I built a GraphQL server as follows, import express from 'express'; import graphqlHTTP from 'express-graphql'; import { schema } from './data/schema'; const app = express(); app.use(express.static(__dirname + '/public')); app.get('/', function(req, res) { res.sendFile('index.html'); }); app.use('/graphql', graphqlHTTP({ schema: schema, graphiql: true })); app.listen(8081, () => { console.log('Running server on port localhost:8081/graphql'); }); And I can make a POST call from Postman like