Get a function document

Problem

You need to retrieve the document describing a function within the current database.

Solution

Use the Get function:

Copied!
client.query(
  q.(q.('create_post'))
)
.then((ret) => console.log(ret))
.catch((err) => console.error(
  'Error: [%s] %s: %s',
  err.name,
  err.message,
  err.errors()[0].description,
))
{
  ref: ("create_post"),
  ts: 1622572663690000,
  name: 'create_post',
  body: ((["title", "body"], (("posts"), {"data": {"title": ("title"), "body": ("body")}})))
}
Query metrics:
  •    bytesIn:   34

  •   bytesOut:  327

  • computeOps:    1

  •    readOps:    1

  •   writeOps:    0

  •  readBytes:  187

  • writeBytes:    0

  •  queryTime: 10ms

  •    retries:    0

More information

Is this article helpful? 

Tell Fauna how the article can be improved:
Visit Fauna's forums or email docs@fauna.com

Thank you for your feedback!