Skip to content

Latest commit

 

History

History
408 lines (265 loc) · 25.2 KB

CHANGELOG.md

File metadata and controls

408 lines (265 loc) · 25.2 KB

@keystone-next/website

3.1.9

Patch Changes

3.1.8

Patch Changes

3.1.7

Patch Changes

3.1.6

Patch Changes

3.1.5

Patch Changes

  • #6391 bc9088f05 Thanks @bladey! - Adds support for introspection in the Apollo Server config. Introspection enables you to query a GraphQL server for information about the underlying schema. If the playground is enabled then introspection is automatically enabled - unless specifically disabled.

3.1.4

Patch Changes

3.1.3

Patch Changes

3.1.2

Patch Changes

  • #6029 038cd09a2 Thanks @bladey! - Updated Keystone URL reference from next.keystonejs.com to keystonejs.com.

3.1.1

Patch Changes

3.1.0

Minor Changes

Patch Changes

  • #5806 0eadba2ba Thanks [@list({](https://github.com/list({), [@list({](https://github.com/list({)! - Removed withItemData in favour of a sessionData option to the createAuth() function.

    Previously, withItemData would be used to wrap the config.session argument:

    import { config, createSchema, list } from '@keystone-next/keystone/schema';
    import { statelessSessions, withAuthData } from '@keystone-next/keystone/session';
    import { text, password, checkbox } from '@keystone-next/fields';
    import { createAuth } from '@keystone-next/auth';
    
    const { withAuth } = createAuth({
      listKey: 'User',
      identityField: 'email',
      secretField: 'password',
    });
    
    const session = statelessSessions({ secret: '-- EXAMPLE COOKIE SECRET; CHANGE ME --' });
    
    export default withAuth(
      config({
        lists: createSchema({
    
            fields: {
              email: text({ isUnique: true }),
              password: password(),
              isAdmin: checkbox(),
            },
          }),
          session: withItemData(session, { User: 'id isAdmin' }),
        }),
      })
    );

    Now, the fields to populate are configured on sessionData in createAuth, and withItemData is completely removed.

    import { config, createSchema, list } from '@keystone-next/keystone/schema';
    import { statelessSessions } from '@keystone-next/keystone/session';
    import { text, password, checkbox } from '@keystone-next/fields';
    import { createAuth } from '@keystone-next/auth';
    
    const { withAuth } = createAuth({
      listKey: 'User',
      identityField: 'email',
      secretField: 'password',
      sessionData: 'id isAdmin',
    });
    
    const session = statelessSessions({ secret: '-- EXAMPLE COOKIE SECRET; CHANGE ME --' });
    
    export default withAuth(
      config({
        lists: createSchema({
    
            fields: {
              email: text({ isUnique: true }),
              password: password(),
              isAdmin: checkbox(),
            },
          }),
          session,
        }),
      })
    );
  • #5767 02af04c03 Thanks @timleslie! - Deprecated the sortBy GraphQL filter. Updated the orderBy GraphQL filter with an improved API.

    Previously a User list's allUsers query would have the argument:

    orderBy: String

    The new API gives it the argument:

    orderBy: [UserOrderByInput!]! = []

    where

    input UserOrderByInput {
      id: OrderDirection
      name: OrderDirection
      score: OrderDirection
    }
    
    enum OrderDirection {
      asc
      desc
    }

    Rather than writing allUsers(orderBy: "name_ASC") you now write allUsers(orderBy: { name: asc }). You can also now order by multiple fields, e.g. allUsers(orderBy: [{ score: asc }, { name: asc }]). Each UserOrderByInput must have exactly one key, or else an error will be returned.

  • #5791 9de71a9fb Thanks @timleslie! - Changed the return type of allItems(...) from [User] to [User!], as this API can never have null items in the return array.
  • #5769 08478b8a7 Thanks @timleslie! - The GraphQL query _all<Items>Meta { count } generated for each list has been deprecated in favour of a new query <items>Count, which directy returns the count.

    A User list would have the following query added to the API:

    usersCount(where: UserWhereInput! = {}): Int
  • Updated dependencies [5cc35170f, 3a7acc2c5]:

3.0.0

Major Changes

Patch Changes

2.0.2

Patch Changes

2.0.1

Patch Changes

2.0.0

Major Changes

  • #5397 a5627304b Thanks @bladey! - Updated Node engine version to 12.x due to 10.x reaching EOL on 2021-04-30.

Patch Changes

  • #5451 9e060fe83 Thanks @JedWatson! - With the goal of making the Lists API (i.e context.lists.{List}) more intuitive to use, the resolveFields option has been deprecated in favor of two new methods:

    (1) You can specify a string of fields to return with the new query option, when you want to query for resolved field values (including querying relationships and virtual fields). This replaces the resolveFields: false use case.

    For example, to query a Post you would now write:

    const [post] = await context.lists.Post.findMany({
      where: { slug },
      query: `
        title
        content
        image {
          src
          width
          height
        }`,
    });

    (2) Alternatively, there is a new set of APIs on context.db.lists.{List} which will return the unresolved item data from the database (but with read hooks applied), which can then be referenced directly or returned from a custom mutation or query in the GraphQL API to be handled by the Field resolvers. This replaces the resolveFields: boolean use case.

    For example, to query for the raw data stored in the database, you would write:

    const [post] = await context.db.lists.Post.findMany({
      where: { slug },
    });
  • #5467 7498fcabb Thanks @timleslie! - Removed the deprecated context.executeGraphQL. Identical functionality is available via context.graphql.raw.

1.3.0

Minor Changes

  • #5368 b40016301 Thanks @timleslie! - The config option db.adapter is now deprecated. It has been repaced with db.provider which can take the values postgresql or sqlite.

Patch Changes

1.2.0

Minor Changes

  • #4912 d31acf61b Thanks @timleslie! - Added a config.graphql.apolloConfig option to allow developers to configure the ApolloServer object provided by Keystone.

Patch Changes

1.1.1

Patch Changes

1.1.0

Minor Changes

Patch Changes

1.0.0

Major Changes

Patch Changes

0.1.1

Patch Changes

0.1.0

Minor Changes

Patch Changes