From f5c5d33639b6b9f089aa527de65b46a28d8adba0 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Thu, 3 Nov 2016 22:08:41 +0100 Subject: [PATCH 1/2] Fix import paths to match graphene>=1.0 paths --- docs/types/scalars.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/types/scalars.rst b/docs/types/scalars.rst index 139750ee..4cfc09fd 100644 --- a/docs/types/scalars.rst +++ b/docs/types/scalars.rst @@ -24,8 +24,8 @@ The following is an example for creating a DateTime scalar: .. code:: python import datetime - from graphene.core.classtypes import Scalar - from graphql.core.language import ast + from graphene.types import Scalar + from graphql.language import ast class DateTime(Scalar): '''DateTime Scalar Description''' From b2d7dfe5461913f94b5859f071d5b998a5b22afc Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Thu, 3 Nov 2016 22:17:37 +0100 Subject: [PATCH 2/2] Fix sentences to be more readable --- docs/types/scalars.rst | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/types/scalars.rst b/docs/types/scalars.rst index 4cfc09fd..a75c70e4 100644 --- a/docs/types/scalars.rst +++ b/docs/types/scalars.rst @@ -47,8 +47,8 @@ The following is an example for creating a DateTime scalar: Mounting Scalars ---------------- -These scalars, if are mounted in a ``ObjectType``, ``Interface`` or -``Mutation``, act as ``Field``\ s. Note: when using the ``Field`` constructor directly, pass the type and not an instance. +If a scalar is mounted in an ``ObjectType``, ``Interface`` or +``Mutation``, they act as ``Field``\ s: .. code:: python @@ -60,7 +60,11 @@ These scalars, if are mounted in a ``ObjectType``, ``Interface`` or name = graphene.Field(graphene.String) -If the types are mounted in a ``Field``, would act as ``Argument``\ s. +**Note:** when using the ``Field`` constructor directly, pass the type and +not an instance. + + +If the types are mounted in a ``Field``, they act as ``Argument``\ s: .. code:: python