MCPcopy
hub / github.com/redwoodjs/graphql / find

Method find

packages/record/src/redwoodrecord/Core.js:62–75  ·  view source on GitHub ↗
(id, options = {})

Source from the content-addressed store, hash-verified

60
61 // Find a single record by ID.
62 static async find(id, options = {}) {
63 const record = await this.findBy(
64 {
65 [this.primaryKey]: id,
66 ...(options.where || {}),
67 },
68 options,
69 )
70 if (record === null) {
71 throw new Errors.RedwoodRecordNotFoundError(this.name)
72 }
73
74 return record
75 }
76
77 // Returns the first record matching the given `where`, otherwise first in the
78 // whole table (whatever the DB determines is the first record)

Callers 15

enforceBabelDependenciesFunction · 0.45
#schemaForModelMethod · 0.45
#parseHasManyMethod · 0.45
Core.test.jsFile · 0.45
parseDatamodelFunction · 0.45
ImportDeclarationFunction · 0.45
getCellMetadataFunction · 0.45
api.test.tsFile · 0.45
setup.test.tsFile · 0.45

Calls 1

findByMethod · 0.95

Tested by 4

updateMethod · 0.36
findUniqueMethod · 0.36
updateMethod · 0.36
findUniqueMethod · 0.36