Open JakeHartnell opened 7 years ago
Hey @JakeHartnell . I'm starting to take a look at this, and was wondering how environments should be implemented. Are they simply a collection of constants?
Are they simply a collection of constants?
Yes.
I think it would be simply be an extension of the thing schema. See: https://github.com/aruntk/grow-graphql-api/blob/master/src/schema/things.js
We could modify it to have something like a contains
property which would be a list of subthings! Just an idea.
export const ThingSchema = [`
type subThings {
// a list of things.
}
scalar Date
type Thing {
_id: String!
uuid: String!
token: String,
owner: String,
component: String,
name : String,
onlineSince: Boolean,
contains: subThings,
properties: Object,
registeredAt: Date
}
`,
];
Eventually we'll need some UI for grouping things into "Environments".
We're going to be switching to GraphQL soon #315, I'm currently reading through this: http://graphql.org/learn/queries/
gotcha. Should the code for environment
be defined in Grow.js
then?
Environments are simply a collection of things.
An environment such as a grow room or greenhouse might contain the following:
Environments are ways to group things together.