Struggling getting started with queries and setup

I setup a really simple schema, one object with like 7 fields.

I’m trying to query against a boolean field, but it keeps complaining the field isn’t in the filter. I can see the filter if I view via GraphQL Playground, but no where do I see where I can edit the filter.

I’m basically just trying to return results that have a field set to true. I’ve looked at dozen graphql and dgraph tutorials, and nothing works as shown in examples. Trying to use api explorer is really frustrating, as you can’t toggle between query/mutation/subscription without trying to add one, and no where do I see where to edit all the hidden stuff like filters.

Example schema

type person @withSubscription {
	id: ID! 
	is_active: Boolean! 
	start_date: DateTime! 
}

I’m trying to return all entries that have is_active == true.

When I do the obvious options, I get a message is_active is not in personfilter.

If you want to filter by a field, then you need to add @search directive on that field.

type person @withSubscription {
  id: ID!
  is_active: Boolean! @search
  start_date: DateTime!
}

Docs: https://dgraph.io/docs/graphql/schema/search/

1 Like

omg, thank you. I thought @search was only for full text search.

@acarey Maybe an improvement can be made on this?

2 Likes