随笔分类 - GraphQL
摘要:Apollo Client is a comprehensive state management library for JavaScript that enables you to manage both local and remote data with GraphQL. Use it to
阅读全文
摘要:In functions/graphql/index.js file: const { ApolloServer, gql } = require("apollo-server-lambda"); const typeDefs = gql` type Query { todos: [Todo]! }
阅读全文
摘要:As you can see "Characters" take two params, page & filter. Here use two alias: allChars: characters fullNmae: name. Alias is also useful when you nee
阅读全文
摘要:When using useQuery from Apollo React Hooks, the request will be sent automatically after the component has been mounted. This might not be the desire
阅读全文
摘要:Unions are used when we want a GraphQL field or list to handle multiple types of data. With a Union Type, we can define a field that could resolve com
阅读全文
摘要:Interfaces are similar to Unions in that they provide a mechanism for dealing with different types of data. However, an interface is more suited for d
阅读全文
摘要:Fragments are selection sets that can be used across multiple queries. They allow you to refactor redundant selection sets, and they are essential whe
阅读全文
只有注册用户登录后才能阅读该文。
摘要:query($category:PetCategory=CAT, $status:PetStatus=AVAILABLE) { #availablePets is the alias availablePets:totalPets(status: AVAILABLE), #checkoutPets
阅读全文
只有注册用户登录后才能阅读该文。
只有注册用户登录后才能阅读该文。
摘要:Showing how to use 'uqrl' library to do GraphQL in React.
阅读全文
摘要:With GraphQL, every field and nested object can have a set of arguments which can be used to request very specific data from a GraphQL API. In this le
阅读全文
摘要:A GraphQL fragment encapsulates a collection of fields that can be included in queries. In this video, we'll look at how to create fragments on types
阅读全文
摘要:Get started with apollo server with node.js: Install: index.js:
阅读全文
摘要:To query a GraphQL API, all you need to do is send an HTTP request that includes the query operation in the body of the request. In this lesson, we wi
阅读全文
摘要:In this lesson, you will learn how to query local and remote data in Apollo Link State in the same component. We'll set the @client decorator on the l
阅读全文
摘要:In this lesson I refactor some code that utilizes the Mutation component to update client-side cache to use the new ApolloConsumer component baked int
阅读全文
摘要:In this lesson I refactor a React component that utilizes a higher-order component for mutations to the new Mutation render prop component baked into
阅读全文
摘要:Sometimes, you want to resues object type when doing mutation, you can use 'input' type to help: Doc
阅读全文