impl From<ID> for Cursor

This commit is contained in:
Samuel Hurel 2020-05-10 16:25:16 +02:00
parent 0344b0b996
commit 9993e86427

View File

@ -1,4 +1,4 @@
use crate::{InputValueError, InputValueResult, Result, ScalarType, Value};
use crate::{InputValueError, InputValueResult, Result, ScalarType, Value, ID};
use async_graphql_derive::Scalar;
use std::ops::{Deref, DerefMut};
@ -32,6 +32,12 @@ where
}
}
impl From<ID> for Cursor {
fn from(id: ID) -> Self {
Cursor(id.into())
}
}
#[Scalar(internal)]
impl ScalarType for Cursor {
fn type_name() -> &'static str {