Merge pull request #640 from Miaxos/misc-add-documentation-for-uuid
misc: add documentations for naive_time url and uuid
This commit is contained in:
commit
961571de91
19
src/types/external/naive_time.rs
vendored
19
src/types/external/naive_time.rs
vendored
@ -3,6 +3,13 @@ use chrono::{NaiveDate, NaiveDateTime, NaiveTime};
|
|||||||
use crate::{InputValueError, InputValueResult, Scalar, ScalarType, Value};
|
use crate::{InputValueError, InputValueResult, Scalar, ScalarType, Value};
|
||||||
|
|
||||||
#[Scalar(internal)]
|
#[Scalar(internal)]
|
||||||
|
/// ISO 8601 calendar date without timezone.
|
||||||
|
/// Format: %Y-%m-%d
|
||||||
|
///
|
||||||
|
/// # Examples
|
||||||
|
///
|
||||||
|
/// * `1994-11-13`
|
||||||
|
/// * `2000-02-24`
|
||||||
impl ScalarType for NaiveDate {
|
impl ScalarType for NaiveDate {
|
||||||
fn parse(value: Value) -> InputValueResult<Self> {
|
fn parse(value: Value) -> InputValueResult<Self> {
|
||||||
match value {
|
match value {
|
||||||
@ -17,6 +24,13 @@ impl ScalarType for NaiveDate {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[Scalar(internal)]
|
#[Scalar(internal)]
|
||||||
|
/// ISO 8601 time without timezone.
|
||||||
|
/// Allows for the nanosecond precision and optional leap second representation.
|
||||||
|
/// Format: %H:%M:%S%.f
|
||||||
|
///
|
||||||
|
/// # Examples
|
||||||
|
///
|
||||||
|
/// * `08:59:60.123`
|
||||||
impl ScalarType for NaiveTime {
|
impl ScalarType for NaiveTime {
|
||||||
fn parse(value: Value) -> InputValueResult<Self> {
|
fn parse(value: Value) -> InputValueResult<Self> {
|
||||||
match value {
|
match value {
|
||||||
@ -31,6 +45,11 @@ impl ScalarType for NaiveTime {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[Scalar(internal)]
|
#[Scalar(internal)]
|
||||||
|
/// ISO 8601 combined date and time without timezone.
|
||||||
|
///
|
||||||
|
/// # Examples
|
||||||
|
///
|
||||||
|
/// * `2015-07-01T08:59:60.123`,
|
||||||
impl ScalarType for NaiveDateTime {
|
impl ScalarType for NaiveDateTime {
|
||||||
fn parse(value: Value) -> InputValueResult<Self> {
|
fn parse(value: Value) -> InputValueResult<Self> {
|
||||||
match value {
|
match value {
|
||||||
|
1
src/types/external/url.rs
vendored
1
src/types/external/url.rs
vendored
@ -3,6 +3,7 @@ use url::Url;
|
|||||||
use crate::{InputValueError, InputValueResult, Scalar, ScalarType, Value};
|
use crate::{InputValueError, InputValueResult, Scalar, ScalarType, Value};
|
||||||
|
|
||||||
#[Scalar(internal)]
|
#[Scalar(internal)]
|
||||||
|
/// URL is a String implementing the [URL Standard](http://url.spec.whatwg.org/)
|
||||||
impl ScalarType for Url {
|
impl ScalarType for Url {
|
||||||
fn parse(value: Value) -> InputValueResult<Self> {
|
fn parse(value: Value) -> InputValueResult<Self> {
|
||||||
match value {
|
match value {
|
||||||
|
8
src/types/external/uuid.rs
vendored
8
src/types/external/uuid.rs
vendored
@ -3,6 +3,14 @@ use uuid::Uuid;
|
|||||||
use crate::{InputValueError, InputValueResult, Scalar, ScalarType, Value};
|
use crate::{InputValueError, InputValueResult, Scalar, ScalarType, Value};
|
||||||
|
|
||||||
#[Scalar(internal, name = "UUID")]
|
#[Scalar(internal, name = "UUID")]
|
||||||
|
/// A UUID is a unique 128-bit number, stored as 16 octets. UUIDs are parsed as Strings
|
||||||
|
/// within GraphQL. UUIDs are used to assign unique identifiers to entities without requiring a central
|
||||||
|
/// allocating authority.
|
||||||
|
///
|
||||||
|
/// # References
|
||||||
|
///
|
||||||
|
/// * [Wikipedia: Universally Unique Identifier](http://en.wikipedia.org/wiki/Universally_unique_identifier)
|
||||||
|
/// * [RFC4122: A Universally Unique IDentifier (UUID) URN Namespace](http://tools.ietf.org/html/rfc4122)
|
||||||
impl ScalarType for Uuid {
|
impl ScalarType for Uuid {
|
||||||
fn parse(value: Value) -> InputValueResult<Self> {
|
fn parse(value: Value) -> InputValueResult<Self> {
|
||||||
match value {
|
match value {
|
||||||
|
Loading…
Reference in New Issue
Block a user