How to use the auto-relay.RelayedQuery function in auto-relay

To help you get started, we’ve selected a few auto-relay examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github wemaintain / auto-relay / tests / suites / _typeorm / sorting.ts View on Github external
@Resolver(() => SortableEntity)
export class SortingResolver {

  constructor() {
    // Array.of(50).map(() => SortableEntity.insert({}))
  }

  @Query(() => String)
  @Sortable(() => SortableEntity)
  public async sortableEntities(
    @OrderOptions() order: TypeORMOrdering
  ) {
    return JSON.stringify(order)
  }

  @RelayedQuery(() => SortableEntity)
  public async sortableEntitiesRelayed() {
    return SortableEntity.findAndCount({})
  }

}

auto-relay

Relay made simple in code-first GraphQL typescript applications

Apache-2.0
Latest version published 3 years ago

Package Health Score

45 / 100
Full package analysis