import gql from "graphql-tag";
import { connect, Process } from "@truffle/db";
const db = connect({
// ...
});
const { Run, resources } = Process;
const { run } = Run.forDb(db);
const { contents } = await run(resources.get, "sources", "0x...", gql`
fragment Contents on Source {
contents
}
`);
Generated using TypeDoc
resources.getRetrieves full or partial representations of a resource given its ID. Parameter
documentis 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
asyncbehavior, use with a [[Meta.Process.ProcessorRunner | ProcessorRunner]] such as that returned by [[Run.forDb]] or [[Project.run]].