使用节点js和graphql使用承运人代码过滤amadeus航班优惠
我必须使用origin, destination, departureDate, carrier
过滤flightoffer>
但是在将载体添加到参数中时出现了此错误消息Some of the parameters were not recognized. Please check your query.
如何通过将载体传递给amadeus查询来过滤结果?
查询
import * as Sentry from '@sentry/node';
import amadeus from './../../../../amadeus';
export default async (parent, args, context, info) => {
try {
const { result } = await amadeus.shopping.flightOffers.get({
origin: args.filter.origin,
destination: args.filter.destination,
departureDate: args.filter.departureDate,
carrier: args.filter.carrier
});
context.dictionaries =await result.dictionaries;
return result.data;
} catch (error) {
console.log(error);
Sentry.captureException(error);
return [];
}
};
我必须使用始发地,目的地,出发日期,承运人来过滤FlightOffer,但是在将承运人添加到参数中时出现了此错误消息,某些参数无法识别。 ...
回答如下:通过查看您的代码尚不清楚是使用Flight Low-fare Search API还是Flight Offers Search API。