mirror of
https://github.com/graphql-python/graphene.git
synced 2025-09-21 11:22: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
|
||||
_meta.node = node
|
||||
_meta.fields = OrderedDict(
|
||||
[
|
||||
(
|
||||
"page_info",
|
||||
Field(
|
||||
PageInfo,
|
||||
name="pageInfo",
|
||||
required=True,
|
||||
description="Pagination data for this connection.",
|
||||
),
|
||||
),
|
||||
(
|
||||
"edges",
|
||||
Field(
|
||||
NonNull(List(edge)),
|
||||
description="Contains the nodes in this connection.",
|
||||
),
|
||||
),
|
||||
]
|
||||
if not _meta.fileds:
|
||||
_meta.fields = OrderedDict()
|
||||
_meta.fields.update(
|
||||
page_info=Field(
|
||||
PageInfo,
|
||||
name="pageInfo",
|
||||
required=True,
|
||||
description="Pagination data for this connection.",
|
||||
),
|
||||
edges=Field(
|
||||
NonNull(List(edge)),
|
||||
description="Contains the nodes in this connection.",
|
||||
),
|
||||
)
|
||||
return super(Connection, cls).__init_subclass_with_meta__(
|
||||
_meta=_meta, **options
|
||||
|
|
Loading…
Reference in New Issue
Block a user