Skip to content

Hide runtime values during planning! #2421

Open
@benjie

Description

@benjie

User wrote this planning code:

holidayparkOperatorPackagesById(_query, args: OperatorPackageByIdFieldArgs) {
                    const { $ID } = args;

                    const relayId = Buffer.from($ID.value, 'base64').toString('utf8');
                    const parts = JSON.parse(relayId);
                    const parkOperatorId = parts[1];

                    console.log(parkOperatorId);

                    const $holidaypark_operator_packages = holidaypark_operator_package.find({
                        park_operator_id: parkOperatorId,
                    });
                    return connection($holidaypark_operator_packages);
                },

this caused issues because they're reading the raw value from $ID which represents the value that it had at planning time, and not necessarily the value it will have a future runtimes.

We should make sure things like value here are hidden away, perhaps using symbols, or private properties, such that users cannot accidentally read these values when planning and think they know what to do.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    🦟 Mayfly

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions