mirror of
https://github.com/graphql-python/graphene.git
synced 2025-09-21 19:32:33 +03:00
Allow fields to be defined when Meta is passed in
This commit is contained in:
parent
32565ef39b
commit
0964453b81
|
@ -86,25 +86,19 @@ class Connection(ObjectType):
|
||||||
|
|
||||||
options["name"] = name
|
options["name"] = name
|
||||||
_meta.node = node
|
_meta.node = node
|
||||||
_meta.fields = OrderedDict(
|
if not _meta.fileds:
|
||||||
[
|
_meta.fields = OrderedDict()
|
||||||
(
|
_meta.fields.update(
|
||||||
"page_info",
|
page_info=Field(
|
||||||
Field(
|
|
||||||
PageInfo,
|
PageInfo,
|
||||||
name="pageInfo",
|
name="pageInfo",
|
||||||
required=True,
|
required=True,
|
||||||
description="Pagination data for this connection.",
|
description="Pagination data for this connection.",
|
||||||
),
|
),
|
||||||
),
|
edges=Field(
|
||||||
(
|
|
||||||
"edges",
|
|
||||||
Field(
|
|
||||||
NonNull(List(edge)),
|
NonNull(List(edge)),
|
||||||
description="Contains the nodes in this connection.",
|
description="Contains the nodes in this connection.",
|
||||||
),
|
),
|
||||||
),
|
|
||||||
]
|
|
||||||
)
|
)
|
||||||
return super(Connection, cls).__init_subclass_with_meta__(
|
return super(Connection, cls).__init_subclass_with_meta__(
|
||||||
_meta=_meta, **options
|
_meta=_meta, **options
|
||||||
|
|
Loading…
Reference in New Issue
Block a user