Skip to main content

EnvFile

API reference

A collection of environment variables.

Implements Node

exists(name: String!): Boolean!

Check if a variable exists

name: String!

Variable name

get(name: String!, raw: Boolean): String!

Lookup a variable (last occurrence wins) and return its value, or an empty string

name: String!

Variable name

raw: Boolean

Return the value exactly as written to the file. No quote removal or variable expansion

id: ID!

A unique identifier for this EnvFile.

asFile: File!

Return as a file

namespace(prefix: String!): EnvFile!

Filters variables by prefix and removes the pref from keys. Variables without the prefix are excluded. For example, with the prefix "MY_APP_" and variables: MY_APP_TOKEN=topsecret MY_APP_NAME=hello FOO=bar the resulting environment will contain: TOKEN=topsecret NAME=hello

prefix: String!

The prefix to filter by

variables(raw: Boolean): [EnvVariable!]!

Return all variables

raw: Boolean

Return values exactly as written to the file. No quote removal or variable expansion

withoutVariable(name: String!): EnvFile!

Remove all occurrences of the named variable

name: String!

Variable name

withVariable(name: String!, value: String!): EnvFile!

Add a variable

name: String!

Variable name

value: String!

Variable value

References

Returned by

Accepted as an argument by