Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d18a010

Browse filesBrowse files
committed
Merge remote-tracking branch 'origin/feat/pydantic-v2' into feat/pydantic-v2
2 parents be7bf62 + ec5c811 commit d18a010
Copy full SHA for d18a010

File tree

Expand file treeCollapse file tree

3 files changed

+10
-46
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+10
-46
lines changed

‎graphene_pydantic/converters.py

Copy file name to clipboardExpand all lines: graphene_pydantic/converters.py
+7-2Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
from types import UnionType
1111

1212
import graphene
13-
from bson import ObjectId
1413
from graphene import (Boolean, Enum, Field, Float, ID, InputField, Int, JSONString, List, String, UUID, Union)
1514
from graphene.types.base import BaseType
1615
from graphene.types.datetime import Date, DateTime, Time
@@ -23,6 +22,12 @@
2322

2423
GRAPHENE2 = graphene.VERSION[0] < 3
2524

25+
try:
26+
from bson import ObjectId
27+
BSON_OBJECT_ID_SUPPORTED = True
28+
except ImportError:
29+
BSON_OBJECT_ID_SUPPORTED = False
30+
2631
try:
2732
from graphene.types.decimal import Decimal as GrapheneDecimal
2833

@@ -183,7 +188,7 @@ def find_graphene_type(
183188
return Boolean
184189
elif type_ == float:
185190
return Float
186-
elif type_ == ObjectId:
191+
elif BSON_OBJECT_ID_SUPPORTED and type_ == ObjectId:
187192
return ID
188193
elif type_ == dict:
189194
return JSONString

‎poetry.lock

Copy file name to clipboardExpand all lines: poetry.lock
+1-40Lines changed: 1 addition & 40 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎pyproject.toml

Copy file name to clipboardExpand all lines: pyproject.toml
+2-4Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "graphene_pydantic"
3-
version = "0.4.2"
3+
version = "0.5.0"
44
description = "Graphene Pydantic integration"
55
readme = "README.md"
66
repository = "https://github.com/graphql-python/graphene-pydantic"
@@ -13,20 +13,18 @@ classifiers = [
1313
"Development Status :: 3 - Alpha",
1414
"Intended Audience :: Developers",
1515
"Topic :: Software Development :: Libraries",
16-
"Programming Language :: Python :: 3.6",
17-
"Programming Language :: Python :: 3.7",
1816
"Programming Language :: Python :: 3.8",
1917
"Programming Language :: Python :: 3.9",
2018
"Programming Language :: Python :: 3.10",
2119
"Programming Language :: Python :: 3.11",
20+
"Programming Language :: Python :: 3.12",
2221
"Programming Language :: Python :: Implementation :: PyPy",
2322
]
2423
keywords = ["api", "graphql", "protocol", "rest", "relay", "graphene", "pydantic", "model"]
2524

2625
[tool.poetry.dependencies]
2726
python = "^3.7"
2827
graphene = ">=2.1.8"
29-
bson = "^0.5.10"
3028
pydantic = ">=2.0"
3129

3230
[tool.poetry.group.dev.dependencies]

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.