Lists
GraphQL allows us to return lists of elements from our fields.
SDL
type Query { users: [User]}
Clients can query list fields like any other field.
GraphQL
{ users { id name }}
Querying a list field will result in an ordered list containing elements with the specified sub-selection of fields.
Learn more about lists here.
Usage
Lists can be defined like the following.
If our field resolver returns a list type, e.g. IEnumerable<T> or IQueryable<T>, it will automatically be treated as a list type in the schema.
C#
public class Query{ public List<User> GetUsers() { // Omitted code for brevity }}
If our field resolver returns a list type, e.g. IEnumerable<T> or IQueryable<T>, it will automatically be treated as a list type in the schema.
C#public class QueryType : ObjectType{ protected override void Configure(IObjectTypeDescriptor descriptor) { descriptor.Name(OperationTypeNames.Query);
descriptor .Field("users") .Resolve(context => { List<User> users = null;
// Omitted code for brevity
return users; }); }}
We can also be more explicit by specifying a ListType<Type> as the return type.
C#public class QueryType : ObjectType{ protected override void Configure(IObjectTypeDescriptor descriptor) { descriptor.Name(OperationTypeNames.Query);
descriptor .Field("users") .Type<ListType<UserType>>() .Resolve(context => { // Omitted code for brevity }); }}
Last updated on February 17, 2026 by Michael Staib