kriasoft / graphql-starter-kit

💥 Monorepo template (seed project) pre-configured with GraphQL API, PostgreSQL, React, and Joy UI.
https://graphqlstart.com
MIT License
3.88k stars 553 forks source link

[`web`] Update `Route<Component, Query>` TypeScript definition #316

Closed koistya closed 2 years ago

koistya commented 2 years ago

Application Route (example)

  import { graphql } from "relay-runtime";
  import type { Route } from "../core";
- import type { SettingsQueryResponse } from "../queries/SettingsQuery.graphql";
+ import type { SettingsQuery } from "../queries/SettingsQuery.graphql";
  import type Settings from "./Settings";

  export default {
    path: "/settings",
    query: graphql`
      query SettingsQuery {
        me {
          id
          name
          email
        }
      }
    `,
    authorize: true,
    component: () => import(/* webpackChunkName: "settings" */ "./Settings"),
    response: (data) => ({
      title: "Account Settings",
      props: data,
    }),
- } as Route<typeof Settings, SettingsQueryResponse>;
+ } as Route<typeof Settings, SettingsQuery>;