Questions tagged [loopback4]

Questions about LoopBack version 4. Use this tag for LoopBack questions which are specific to only version 4. General LoopBack questions should be tagged with loopbackjs.

Create powerful APIs easily with a new creation experience for defining REST APIs and handling API requests/responses.

A new, improved programming model with dependency injection and new concepts such as components, mixins, repositories, etc. make this the most extensible version yet.

See also

483 questions
0
votes
1 answer

Using loopback4 and graphQL together

import {Lb4Application} from './application'; import {ApplicationConfig} from '@loopback/core'; import graphqlHTTP from 'express-graphql'; import {createGraphQLSchema} from 'openapi-to-graphql'; import {Oas3} from…
ste
  • 53
  • 2
  • 8
0
votes
1 answer

Inserting primary and child records

Following the insert of a record into a postgresql table with a generated primary key, how can I get that key so that I can insert child table records and specify their foreign key? Does the first insert return the primary key in the inserted model…
0
votes
1 answer

Does loopback 4.0 run queries in parallel ever?

I'm trying to understand contexts in Loopback 4. One thing which doesn't make sense to me is how Loopback could tell what the context should be if there were ever two asynchronous queries running in parallel. As in: const ctx; for (let i = 0; i <…
Seph Reed
  • 8,797
  • 11
  • 60
  • 125
0
votes
2 answers

How to serve static content in Loopback 4.0?

I've found this Q&A on loopback, but it doesn't work for 4.0: strongloop loopback how do I serve-static with a route? I want to serve some basic static content. Or maybe even arbitrary content. This is how things usually work with express…
Seph Reed
  • 8,797
  • 11
  • 60
  • 125
0
votes
0 answers

how to mock aws service in unit tests in loopback4

I want to mock AWS service in unit tests , we already have aws service used in controller but how to make mock service of aws and replace the working of actual service to mock service to get values on which my entity depends in unit tests async…
0
votes
1 answer

Using _id from MongoDb as ID in Loopback 4

I want use the _id(ObjectId) create as unique key on mongoDB as the id from my model. (with a sql database i coult use the auto increment from database to control this) The model where is the attribute: @property({ type: 'number', id:…
0
votes
1 answer

NodeJS: How to do a many to many relation using Loopback4

I'm building a blog API using the Loopback 4 framework and I didn't find in documentation or any article on the internet for how to do many to many relationships (Posts and Categories) So my question is: How to do such a relation in LoopBack 4? and…
hesham shawky
  • 1,073
  • 4
  • 21
  • 44
0
votes
1 answer

Loopback 4 extending REST model-endpoints

I have created all of my REST model-endpoints using the REST CRUD model-endpoint generator. I would like add additional endpoints to the generated controller. Is this possible? I can't find any documentation that tells me how to do this. I suppose…
0
votes
1 answer

loopback4 - Wrong relation mapping in openapi spec

im struggling with the mapping to openapi spec of relations in loopback 4. There are two entities: Plan & PlanItem with relates with "Plan hasMany PlanItems" In my endpoint spec i've declared the inclusion of the relation like that: …
Peter C. Glade
  • 543
  • 2
  • 8
  • 16
0
votes
1 answer

Loopback 4 controller Omit

I'm giving my first steps in Loopback 4, and I've been trying to follow the tutorial that they have to generate a new REST Api. The thing is that after creating my model, database and repository, I started to develop my controller class and…
RafDias
  • 21
  • 1
  • 7
0
votes
0 answers

Call controller from another controller and decide action based on the response

I have no idea how to do the following : I have this route : "localhost:3000/t-clients/{id}/t-consents" What it does : Storing the path for an image which should also be uploaded to the path. The table in the database looks like this : So, on a…
Pouissante
  • 56
  • 1
  • 5
  • 25
0
votes
1 answer

Validating openapi 3.0 API description against backend implementation of the API in Loopback 4

I tried Dredd but it's not working with openapi spec 3.0 that is generated by Loopback 4 framework. I wanted to know what are the options available for this type of testing where I want to validate the openapi 3.0 API description against backend…
VISHAL DAGA
  • 4,132
  • 10
  • 47
  • 53
0
votes
1 answer

attachement SendinBlue Api with nodejs

i want to use Sendinblue api with my lb4 application to send mails but i have some difficulties in attachment , can i get a clean example for linking sendinblue api V3 with loopback4 (nodejs) thanks
0
votes
1 answer

SheetJS always throws the same output

I'm having a problem parsing an ".xlsx" or ".xls" file with SheetJS ("xlsx" on npm) i don´t know what I'm doing wrong, but I always get the same output [ { "__EMPTY": "i" }, { "__EMPTY":"«Z.7¦§dÞZµìe° I'm using an empty controller in…
0
votes
1 answer

Loopback 4 Model Related Logic And Repository Access

I'm working with Loopback 4 and I've an abstract model that has some logic methods (that i think can be placed inside that model, like getters, setters and so on) and some of them needs to do some queries to the DB. I can inject those repositories…