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.

Handle double nesting in blackboxed array

See original GitHub issue
//articleschema
articles: {
      type: Array,
      blackbox: true,
      // typeName:'articles',
      canRead: ['guests'],
      group: articleGroup,
      optional: true,
      // canCreate: ['members'],
      // canUpdate: ['members'],
    },
    'articles.$': {
      type: articleSchema,
      // blackbox: true,
      // typeName:'articles'
    }  ...
const schema = {...  
//blocks
blocks: {
    type: Array,
    canRead: ['guests'],
    group: blockGroup,
    optional: true,
    canCreate: ['members'],
    canUpdate: ['members'],
    blackbox: true
  },
  'blocks.$': {
    type: blockSchema,
  }...

Error

Error: Unknown type "LetterBlocksArticles". Did you mean "LetterBlocksSortInput", "LetterBlocks", "LetterBlocksFilterInput", "LetterSortInput", or "CreateLetterBlocksDataInput"?

I don’t know yet if the solution is to add blackbox:true to the blocks.$ too, but anyway this should either display a relevant warning or not throw an error. Maybe isBlackbox check should be improved to test if array parent is blackboxed

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
eric-burelcommented, Feb 17, 2020

Aaaand solved for mutation types too, it now takes the blackbox into account. Your canUpdate in the child should be ignored instead of blatantly failing.

1reaction
eric-burelcommented, Feb 17, 2020

@GraemeFulton let me know if there are other unexpected issues though, I only fixed the graphql generation bug so far (it won’t create the faulty LetterBlocksArticle type anymore) but there might be other issue I did not expected

Edit: Right I also have the create/update issue if you add a canCreate

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to properly handle state in double nested arrays ...
I am trying to build the following: a forum where one can create a post, which triggers the ADD_POST, and the post is...
Read more >
Understanding Nested Arrays in JavaScript
JavaScript lets us create arrays inside array called Nested Arrays. Nested Arrays have one or many arrays as the element of an array....
Read more >
Adding RTL Blackbox Functions - 2022.1 English
The RTL blackbox enables the use of existing Verilog RTL IP in an HLS project. This lets you add RTL code to your...
Read more >
simpl-schema/README.md at main · longshotlabs ...
Use string keys with MongoDB-style dot notation to validate nested arrays and objects. For example: import SimpleSchema from "simpl-schema"; const schema ...
Read more >
How To Use Alertmanager And Blackbox Exporter ...
Prometheus Alerting is separated into two parts. The first part is handled by the Prometheus server and includes generating alerts based on ...
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