Giter VIP home page Giter VIP logo

Comments (5)

hoegertn avatar hoegertn commented on August 17, 2024 1

I think this is still broken. The onCreateCountry is still not present so the original issue still exists.

@danyuep Can you confirm this?

from amplify-codegen.

AaronZyLee avatar AaronZyLee commented on August 17, 2024

For now OnCreateCountryListener from generated angular service code is an Observerable<OnCreateCountrySubscription> variable type. Have you tried another way by adding a .subscribe()? The full code snippet is as following.

APIService.OnCreateCountryListener.subscribe({
next: (data) => {const createdCountry = data.onCreateCountry;},
error: (error) => console.error(error)
});

from amplify-codegen.

danyuep avatar danyuep commented on August 17, 2024

Sorry this is a typo here. The actual code looks like this:

this.apiService.OnCreateCountryListener.subscribe(c => {
       const country = (c as unknown as IWorkaround).value.data.onCreateCountry;
}

with

interface IWorkaround {
   value: {
     data: {
       onCreateCountry: OnCreateCountrySubscription;
     };
   };
}

I have not used subscriptions since the creation of this issue, this might have been already fixed in the meantime, i do not know.

from amplify-codegen.

danyuep avatar danyuep commented on August 17, 2024

I just checked my code-generated API service.
The return type changed from
Observable<OnCreateCountrySubscription>>
to
Observable<SubscriptionResponse<OnCreateCountrySubscription>

and SubscriptionResponse seems to have the structure of the Workaround I used. Looks like this was fixed now.

from amplify-codegen.

AaronZyLee avatar AaronZyLee commented on August 17, 2024

Looks like the bug is fixed by this PR. I close this issue for now but feel free to reopen it if your problem is not resolved.

from amplify-codegen.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.