Skip to main content

tartiflette-plugin-isodatenow

Buddy.Works logo.

buddy pipeline

ISO Date Format Directive for Tartiflette

TOC

Overview

The tartiflette-plugin-isodatenow plugin adds an @isoDateNow directive to tartiflette. It sets the field that it is on with the current time in ISO 8601 format. It is primarly intended for use in mutations as the directive overrides any value sent though it can be used in queries where a createdAt or response timestamp is required.

Installation

To install with poetry:

$ poetry add tartiflette-plugin-isodatenow

To install with pip:

$ pip install tartiflette-plugin-isodatenow

Usage

type Example {
    createdAt: String @isoDateNow
}

Querying createdAt would return the following:

{
    "data": {
        "example": {
            "createdAt": "2019-09-04T13:49:12.585158+00:00"
        }
    }
}

Options

The @isoDateNow also takes the following optional arguments:

@isoDateNow(microseconds: false)

Returns date and time without microseconds.

type Example {
    createdAt: String @isoDateNow(microseconds: false)
}

Querying createdAt would return the following:

{
    "data": {
        "example": {
            "createdAt": "2019-09-04T13:49:12+00:00"
        }
    }
}

@isoDateNow(timezone: false)

Returns date and time without timezone.

type Example {
    createdAt: String @isoDateNow(timezone: false)
}

Querying createdAt would return the following:

{
    "data": {
        "example": {
            "createdAt": "2019-09-04T13:49:12.585158"
        }
    }
}

@isoDateNow(utc: false)

Returns date and time in the local timezone.

type Example {
    createdAt: String @isoDateNow(utc: false)
}

Querying createdAt would return the following:

{
    "data": {
        "example": {
            "createdAt": "2019-09-04T09:49:12.585158-04:00"
        }
    }
}

The arguments can be used in any combination and will return an ISO8601 compliant date.

For example settings microseconds to false and timezone to true would yield: 2019-09-04T13:49:12+00:00.

Possible combinations:

  • @isoDateNow >> "2019-09-04T13:49:12.585158+00:00"
  • @isoDateNow(timezone: false) >> "2019-09-04T13:52:43.476260"
  • @isoDateNow(microseconds: false) >> "2019-09-04T13:50:02+00:00"
  • @isoDateNow(microseconds: false, timezone: false) >> "2019-09-04T13:53:31"

The time can also be set to the local time by setting utc to false.

@isoDateNow(utc: false) >> "2019-09-04T09:50:02+00:00"

Using the @isoDateNow directive will override any value sent.

Metadata

Release files for tartiflette-plugin-isodatenow 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tartiflette-plugin-isodatenow 0.2.2
File Size Uploaded
tartiflette-plugin-isodatenow-0.2.2.tar.gz 4.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tartiflette-plugin-isodatenow 0.2.2
File Interpreter ABI Platform
tartiflette_plugin_isodatenow-0.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 8.0 kB

Release files / tartiflette-plugin-isodatenow-0.2.2.tar.gz

Download URL tartiflette-plugin-isodatenow-0.2.2.tar.gz
Size 4.0 kB
Tags Source
SHA-256 checksum
How to use checksums
83c54be71e8d04adc198bea14d46530068433c76ee2c00d815878179302e3681
BLAKE2b-256 checksum
How to use checksums
a0e30934affcbfc2347dca4781210f372f5cf45ef0575341ef00ef6adfef49cf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/0.12.17 CPython/3.7.4 Darwin/18.7.0

Release files / tartiflette_plugin_isodatenow-0.2.2-py3-none-any.whl

Download URL tartiflette_plugin_isodatenow-0.2.2-py3-none-any.whl
Size 4.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9d778af0d82ba6e2a5a93264277dd1bbee322a497740767fe9b1fa17405dd3d1
BLAKE2b-256 checksum
How to use checksums
1e3ddf2a5138a877508c7141af859da79f263805573252dbed0988c9022b24ee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/0.12.17 CPython/3.7.4 Darwin/18.7.0

Release history Release notifications | RSS feed

This release

0.2.2 This release

2 release files

0.2.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page