public RootQueryType(IAsyncBatch batch, RoscoeDb db) { this.batch = batch; this.db = db; provider = batch.Add(new RoscoeAsyncOperation <RoscoeDb>(db)); enumProvider = batch.Add(new ObjectDataProvider <OrgType>(token => Task.FromResult(OrgType.Sme))); }
public RootQueryType(IAsyncBatch batch) { var organisations = new List <OrganisationRecord> { new OrganisationRecord { Id = Guid.NewGuid(), Name = "org 1", Users = { new UserRecord { Id = Guid.NewGuid(), Name = "user 1", }, new UserRecord { Id = Guid.NewGuid(), Name = "user 2", }, }, }, new OrganisationRecord { Id = Guid.NewGuid(), Name = "org 2", Users = { new UserRecord { Id = Guid.NewGuid(), Name = "user 3", }, new UserRecord { Id = Guid.NewGuid(), Name = "user 4", }, }, }, }; organisationProvider = batch.Add(new ObjectDataProvider <OrganisationRecord>(token => Task.FromResult(organisations.AsEnumerable()))); this.batch = batch; }
public IValueAccessor <GraphQLNotNull <GraphQLList <GraphQLNotNull <GraphQLString> > > > Values(Input <GraphQLNotNull <GraphQLList <GraphQLNotNull <GraphQLString> > > > values) => batch.Add(new ObjectDataProvider <string>(token => Task.FromResult(values.ListValue()))) .SelectList <GraphQLString>(x => x);