我正在和gulp一起尝试.我已经设置了这样的任务:
gulp.task('lint', function () {
return gulp.src([
'components/myjs.js'
])
// eslint() attaches the lint output to the eslint property
// of the file object so it can be used by other modules.
.pipe(eslint())
// eslint.format() outputs the lint results to the console.
// Alternatively use eslint.formatEach() (see Docs).
.pipe(eslint.format())
// To have the process exit with an error code (1) on
// lint error, return the stream and pipe to failOnError last.
.pipe(eslint.failOnError());
});
Run Code Online (Sandbox Code Playgroud)
当我跑的时候gulp lint
它告诉我很多错误.现在我试图逐一修复它们.但是我必须gulp lint …
我试图获取在特定日期之前/之后创建的用户,但出现此错误。
"message": "参数 \"filter\" 的值 $filter 无效。\n在字段 \"insertedAfter\" 中:预期类型 \"NaiveDateTime\",找到 \"2018-05-13\"。",
该错误是有道理的,因为“2018-05-13”不是 NativeDateTime...但是,我认为 NativeDateTime 应该解析字符串“2018-05-13”。我正在尝试应用从书本中学到的知识,但遇到困难。我还创建了一个自定义日期标量,但我基本上遇到了相同的错误。
如何使用 phoenix 和苦艾酒搜索在特定日期之后创建的用户?
query($filter: UserFilter){
allUsers(filter: $filter){
id
firstName
lastName
}
}
values
{
"filter": {
"insertedAfter": "2018-05-13"
}
}
Run Code Online (Sandbox Code Playgroud)
Ecto 架构,帐户 > user.ex
schema "users" do
field :avatar_img, :string
field :email, :string, null: false
field :fb_token, :string
field :first_name, :string
field :google_token, :string
field :last_name, :string
field :password, :string, null: false
field :admin_user_id, :string
timestamps()
end
Run Code Online (Sandbox Code Playgroud)
类型.ex
use Absinthe.Schema.Notation
use Absinthe.Ecto, repo: ElixirBlog.Repo
import_types …Run Code Online (Sandbox Code Playgroud)