Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: .args() Broken in .getAll with Compound Index #14

Open
ChrisTalman opened this issue Feb 28, 2018 · 1 comment
Open

Bug: .args() Broken in .getAll with Compound Index #14

ChrisTalman opened this issue Feb 28, 2018 · 1 comment

Comments

@ChrisTalman
Copy link
Contributor

I am receiving this error:

Argument of type '(string | RSpecial<"ARGS">)[]' is not assignable to parameter of type 'KeyType'. Type '(string | RSpecial<"ARGS">)[]' is not assignable to type 'RSpecial<"ARGS">'. Property 'type' is missing in type '(string | RSpecial<"ARGS">)[]'.

It's produced by code which looks similar to the following:

import r from 'rethinkdb';

const array =
[
	'abc',
	'def',
	'hij'
];
const string = 'klm';

r
	.table('name')
	.getAll
	(
		[
			r.args(array),
			string
		],
		{
			index: 'key1_key2'
		}
	)

The compiled code runs correctly without error from the RethinkDB library.

The problem seems to be with r.args in the context of a compound index in a getAll query.

I attempted to look through rethinkdb.d.ts to find the cause of the issue, but have been unsuccessful so far.

If anyone can lend a hand in resolving this, that'd be much appreciated.

@blakeembrey
Copy link
Contributor

Thanks for the notice. Let's add a test and ensure that everywhere r.args can be used is the same as KeyType. If that works, we can merge ASAP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants