Swiftpack.co - Package - Quartz/content
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.

Quartz Content Queries

This repo contains shared GraphQL queries for Quartz content at content.qz.com/graphql.

Queries are used to automatically generate TypeScript types and React hooks for React projects, and Swift types for iOS projects, using Apollo. This repo hosts both an NPM package and a Swift package for client use.

Adding queries

Shared queries can be found in /Queries. Fragments that might be shared in multiple queries are grouped in /Queries/Fragments. Queries related to a single page or function are grouped into folders, for instance, /Queries/Home.

What about __typename?

There’s no need to include __typename in your queries! Types will be introspected automatically.

Generating type definitions

Type definitions are generated automatically when merging to the main branch. (See .github/workflows/generation.yml). However, it’s a good idea to run type generation locally before opening a PR; it can help catch errors like missing fragments or name collisions. If you’d like to test your PR in a consuming repo like qz-react, open the PR, wait for the bot to commit the type definitions, then install the resulting commit in your repo, e.g.:

npm i --save Quartz/content#mysha1

Releases

We’re using GitHub Releases (tags) for versioning. Click on “Releases”, then “Draft a new release”, and tag and title your release using semantic versioning. To update the package in a client project, use: npm i --save Quartz/content#0.0.8.

semver

Client usage

In React projects

npm i --save Quartz/content#0.0.8 # we’re using GitHub Releases (tags) for versioning

Hooks are automatically generated for each operation (query or mutation).

import { useLatestGuidesQuery } from '@quartz/content';

export default function MyComponent() {
	const { data, loading, error } = useLatestGuidesQuery( { variables: { perPage: 3 } } );

In iOS projects

// Package.swift
dependencies: [
    .package(url: "https://github.com/Quartz/content", from: "0.0.8"),
],

Github

link
Stars: 2

Releases

0.1.17 - 2021-01-15T16:43:56

0.1.16 - 2021-01-14T00:01:53

0.1.15 - 2021-01-13T20:28:37

0.1.14 - 2021-01-13T16:16:24

0.1.13 - 2021-01-11T20:09:08

0.1.12 - 2021-01-11T15:50:01

0.1.11 - 2021-01-08T22:18:12

0.1.10 - 2021-01-06T13:03:58

0.1.9 - 2021-01-05T16:28:02

0.1.8 - 2021-01-05T15:20:15

0.1.7 - 2020-12-09T20:52:39

0.1.6 - 2020-12-02T15:17:51

Adds headerImage field to ObsessionParts fragment

0.1.5 - 2020-11-30T15:15:24

0.1.4 - 2020-11-19T16:00:33

0.1.3 - 2020-11-12T22:05:35

Adds new hasEssentials field to Obsession type

0.1.2 - 2020-11-11T17:11:21

0.1.1 - 2020-11-06T19:09:24

0.1.0 - 2020-11-05T15:59:58

0.0.13 - 2020-10-28T17:24:24

0.0.12 - 2020-10-27T21:17:57

0.0.11 - 2020-10-27T20:28:22

0.0.10 - 2020-10-26T21:02:02

0.0.9 - 2020-10-24T14:56:07

0.0.8 - 2020-10-24T14:09:59

0.0.7 - 2020-10-23T14:05:40

0.0.6 - 2020-10-20T18:50:28

  • Taxonomy queries
  • Video hub & Member Home (app-only now)
  • Search
  • Apollo Client factory as part of the Swift package

0.0.5 - 2020-10-16T17:39:57

0.0.4 - 2020-10-16T16:47:00

0.0.3 - 2020-10-14T20:45:50

- 2020-10-14T12:28:31