# Type alias All

All: (<N>(collectionName, document) => Process<Resources.Resource<N>[]>)

#### Type declaration

- - <N>(collectionName, document): Process<Resources.Resource<N>[]>

  - `resources.all`

    Retrieves full or partial representations of all known resources for a given collection name. Parameter `document` is a GraphQL DocumentNode that defines a fragment on the resource object type, to control which fields are returned.

    Note: This function returns a generator. For `async` behavior, use with a [[Meta.Process.ProcessorRunner | ProcessorRunner]] such as that returned by [[Run.forDb]] or [[Project.run]].

    #### Type Parameters

    - #### N extends Resources.CollectionName

    #### Parameters

    - ##### collectionName: N

    - ##### document: graphql.DocumentNode

    #### Returns Process<Resources.Resource<N>[]>

    #### Example

        import gql from "graphql-tag";
        import { connect, Resources, Process } from "@truffle/db";

        const db = connect({
          // ...
        });

        const { Run, resources } = Process;

        const { run } = Run.forDb(db);

        const sources: Pick<
          Resources.Resource<"sources">,
          "contents"
        >[] = await run(resources.all, "sources", gql`
          fragment Contents on Source {
            contents
          }
        `);

- Defined in packages/db/src/process.ts:240

Generated using TypeDoc