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.

Options property can't be re-assigned

See original GitHub issue

Context

Quoting the following lines of code:

Seems like you wouldn’t be able to re-assign properties once the client is initially instantiated. What if someone wanted to parametise some of those constructor settings based on a CP? Like for example:

  options: computed('session.isAuthenticated', function() {
    if (session.get('isAuthenticated')) {
      return {
        apiURL: config.tceuFrontend.apiURL
      };
    } else {
      return {};
    }
  }),

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
shellandbullcommented, Aug 1, 2019

@josemarluedke @buschtoens

I would actually create a new service extending from ember-apollo-client for the case where your users are authenticated.

We ended up doing that for the project, basically separate services for separate APIs and whatnot. Can’t say I agree with apollo’s approach to state management and network interaction strategies 😄 maybe I’ll write a graphQL client myself someday

0reactions
josemarluedkecommented, Jul 31, 2019

I agree with @buschtoens here.

Apollo does not allow to change config after initialized. I would actually create a new service extending from ember-apollo-client for the case where your users are authenticated.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Strange "Val cannot be reassigned" error when setting a ...
What the error message means is that since the types do not match, only the getter is considered as a property. So from...
Read more >
Gradle 5.0 causes error Val cannot be reassigned when using ...
Looking into the class JacocoReportBase I can see that the class property classDirectories is not final and a valid setter has been provided....
Read more >
False positive `Val cannot be reassigned` in `build.gradle.kts`
After reloading, the args assignment will be underlined, because "Val cannot be reassigned". Val cannot be reassigned. However, gradle doSomething compiles ...
Read more >
Managing owners, users, and permissions - Search Console ...
Choose a property in Search Console. · Click the Settings icon Settings in the navigation pane. · Click Users & permissions. · Click...
Read more >
Delegated properties | Kotlin Documentation
operator fun setValue(thisRef: Any?, property: KProperty<*>, value: String) { println("$value has been assigned to '${property.name}' in $thisRef.") } }.
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