question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

dependsOn not working at all in .4.x

See original GitHub issue

With the following code, the “school” field does not work at all. This also appears to apply to the String and Types.Text datatypes.

postType: {
    type: Types.Select,
    options: 'news/update, high school, college',
    default: 'news/update',
    index: true
},
school: {
    type: Types.Relationship,
    ref: 'School',
    index: true,
    dependsOn: {   
        postType: ['high school', 'college']
    }
},

Additionally, saving does not make the field appear.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:16 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
snowkeepercommented, Apr 5, 2016

This is a use case that differs slightly from 0.3.x to 0.4.x. In 0.3.x an Array value is treated as an OR, but in 0.4.x with expression-match it is treated as an AND. So dependsOn is working but returning a false.

The options are: A: Update the docs to reflect using $or for arrays.

dependsOn: {   
        postType: { or:  ['high school', 'college']  }
}

B: Set the default expression as $or in Keystone using the 3rd argument for expression-match.

{ expression: $or }
0reactions
VinayaSathyanarayanacommented, Jun 3, 2017

Can the final syntax be documented?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Gradle dependsOn not working when called again within ...
There's no option to add a task to a DAG (directed acyclic graph - which gradle uses under the hood) more than once....
Read more >
dependsOn is not respected when using --scope #860 - GitHub
I'm trying to run tests for a package, the equivalent of pnpm turbo run test --no-deps --scope=@iw/button . This has a dependency on...
Read more >
Controlling Bean Creation Order with @DependsOn Annotation
This tutorial explores managing Spring initialization order using the @DependsOn annotation.
Read more >
DependsOn (Spring Framework 6.0.3 API)
Using DependsOn at the class level has no effect unless component-scanning is being used. If a DependsOn -annotated class is declared via XML,...
Read more >
Authoring Tasks - Gradle User Manual
Task has actions, but the task tells Gradle it did not change its outputs. Task has no actions and some dependencies, but all...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found